파이프라인에서 OIDC 인증을 사용하는 방법 AWS SAM - AWS Serverless Application Model

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

파이프라인에서 OIDC 인증을 사용하는 방법 AWS SAM

AWS Serverless Application Model (AWS SAM) 는 비트버킷, GitHub 액션, GitLab 지속적 통합 및 지속적 전달 (CI/CD) 플랫폼에 대한 OpenID Connect (OIDC) 사용자 인증을 지원합니다. 이 지원을 통해 모든 플랫폼에서 인증된 CI/CD 사용자 계정을 사용하여 서버리스 애플리케이션 파이프라인을 관리할 수 있습니다. 그렇지 않으면 파이프라인에 대한 액세스를 제어할 여러 AWS Identity and Access Management (IAM) 사용자를 생성하고 관리해야 합니다. AWS SAM

파이프라인으로 OIDC를 설정합니다. AWS SAM

sam pipeline bootstrap구성 프로세스 중에 다음을 수행하여 파이프라인과 함께 OIDC를 설정합니다. AWS SAM

  1. ID 제공자를 선택하라는 메시지가 표시되면 OIDC를 선택합니다.

  2. 다음으로 지원되는 OIDC 공급자를 선택합니다.

  3. https://로 시작하는 OIDC 공급자 URL을 입력합니다.

    참고

    AWS SAM AWS::IAM::OIDCProvider리소스 유형을 생성할 때 이 URL을 참조합니다.

  4. 그런 다음 프롬프트에 따라 선택한 플랫폼에 액세스하는 데 필요한 CI/CD 플랫폼 정보를 입력합니다. 이러한 세부 정보는 플랫폼마다 다르며 다음을 포함할 수 있습니다.

    • OIDC 클라이언트 ID.

    • 코드 리포지토리 이름 또는 범용 고유 식별자(UUID).

    • 리포지토리와 연관된 그룹 또는 조직 이름.

    • GitHub 코드 리포지토리가 속한 조직

    • GitHub 리포지토리 이름.

    • 배포가 이루어지는 브랜치.

  5. AWS SAM 입력한 OIDC 구성의 요약이 표시됩니다. 편집하려면 설정 번호를 입력하거나 Enter를 눌러 계속 진행합니다.

  6. 입력한 OIDC 연결을 지원하는 데 필요한 리소스 생성을 확인하라는 메시지가 표시되면 Y를 눌러 계속 진행합니다.

AWS SAM 파이프라인 실행 역할을 맡는 제공된 구성을 사용하여 AWS::IAM::OIDCProvider AWS CloudFormation 리소스를 생성합니다. 이 AWS CloudFormation 리소스 유형에 대해 자세히 알아보려면 AWS CloudFormation 사용 설명서AWS::IAM::OIDCProvider를 참조하세요.

참고

ID 공급자 (IdP) 리소스가 이미 사용자 AWS 계정내에 있는 경우 새 리소스를 만드는 대신 해당 리소스를 AWS SAM 참조합니다.

다음은 파이프라인을 사용하여 OIDC를 설정하는 예제입니다. AWS SAM

Select a permissions provider:
    1 - IAM (default)
    2 - OpenID Connect (OIDC)
Choice (1, 2): 2
Select an OIDC provider:
    1 - GitHub Actions
    2 - GitLab
    3 - Bitbucket
Choice (1, 2, 3): 1
Enter the URL of the OIDC provider [https://token.actions.githubusercontent.com]:
Enter the OIDC client ID (sometimes called audience) [sts.amazonaws.com]:
Enter the GitHub organization that the code repository belongs to. If there is no organization enter your username instead: my-org
Enter GitHub repository name: testing
Enter the name of the branch that deployments will occur from [main]:

[3] Reference application build resources
Enter the pipeline execution role ARN if you have previously created one, or we will create one for you []:
Enter the CloudFormation execution role ARN if you have previously created one, or we will create one for you []:
Please enter the artifact bucket ARN for your Lambda function. If you do not have a bucket, we will create one for you []:
Does your application contain any IMAGE type Lambda functions? [y/N]:

[4] Summary
Below is the summary of the answers:
    1 - Account: 123456
    2 - Stage configuration name: dev
    3 - Region: us-east-1
    4 - OIDC identity provider URL: https://token.actions.githubusercontent.com
    5 - OIDC client ID: sts.amazonaws.com
    6 - GitHub organization: my-org
    7 - GitHub repository: testing
    8 - Deployment branch: main
    9 - Pipeline execution role: [to be created]
    10 - CloudFormation execution role: [to be created]
    11 - Artifacts bucket: [to be created]
    12 - ECR image repository: [skipped]
Press enter to confirm the values above, or select an item to edit the value:

This will create the following required resources for the 'dev' configuration:
    - IAM OIDC Identity Provider
    - Pipeline execution role
    - CloudFormation execution role
    - Artifact bucket
Should we proceed with the creation? [y/N]:

자세히 알아보기

파이프라인과 함께 AWS SAM OIDC를 사용하는 방법에 대한 자세한 내용은 을 참조하십시오. sam pipeline bootstrap