Amazon CodeCatalyst는 더 이상 신규 고객에게 공개되지 않습니다. 기존 고객은 정상적으로 서비스를 계속 이용할 수 있습니다. 자세한 내용은 CodeCatalyst에서 마이그레이션하는 방법 단원을 참조하십시오.
기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
블루프린트에 보안 암호 구성 요소 추가
CodeCatalyst에서 보안 암호를 사용하여 워크플로에서 참조할 수 있는 민감한 데이터를 저장할 수 있습니다. 사용자 지정 블루프린트에 보안 암호를 추가하고 워크플로에서 참조할 수 있습니다. 자세한 내용은 보안 암호를 사용하여 데이터 마스킹 섹션을 참조하세요.
Amazon CodeCatalyst 블루프린트 리전 유형을 가져오려면
다음을 blueprint.ts 파일에 추가합니다.
import { Secret, SecretDefinition } from '@amazon-codecatalyst/blueprint-component.secrets'
보안 암호 생성
다음 예시에서는 사용자에게 보안 암호 값과 선택적 설명을 입력하라는 메시지를 표시하는 UI 구성 요소를 생성합니다.
export interface Options extends ParentOptions { ... mySecret: SecretDefinition; } export class Blueprint extends ParentBlueprint { constructor(options_: Options) { new Secret(this, options.secret); }
보안 암호 구성 요소에는 name이 필요합니다. 다음 코드는 최소 필수 기본 셰이프입니다.
{ ... "secret": { "name": "secretName" }, }
워크플로에서 보안 암호 참조
다음 예시에서 블루프린트는 보안 암호와 보안 암호 값을 참조하는 워크플로를 생성합니다. 자세한 내용은 워크플로에서 보안 암호 참조 섹션을 참조하세요.
export interface Options extends ParentOptions { ... /** * * @validationRegex /^\w+$/ */ username: string; password: SecretDefinition; } export class Blueprint extends ParentBlueprint { constructor(options_: Options) { const password = new Secret(this, options_.password); const workflowBuilder = new WorkflowBuilder(this, { Name: 'my_workflow', }); workflowBuilder.addBuildAction({ actionName: 'download_files', input: { Sources: ['WorkflowSource'], }, output: { Artifacts: [{ Name: 'download', Files: ['file1'] }], }, steps: [ `curl -u ${options_.username}:${password.reference} https://example.com`, ], }); new Workflow( this, repo, workflowBuilder.getDefinition(), ); }
CodeCatalyst에서 보안 암호 사용에 대한 자세한 내용은 보안 암호를 사용하여 데이터 마스킹 섹션을 참조하세요.