명령을 sam deploy 사용한 배포 소개 - AWS Serverless Application Model

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

명령을 sam deploy 사용한 배포 소개

AWS Serverless Application Model 명령줄 인터페이스 (AWS SAMCLI) sam deploy 명령을 사용하여 서버리스 애플리케이션을 에 AWS 클라우드배포합니다.

사전 조건 

sam deploy를 사용하려면 다음을 완료하여 AWS SAM CLI를 설치합니다.

sam deploy를 사용하기 전에 다음 사항에 대한 기본적인 이해를 하는 것이 좋습니다.

sam deploy를 사용하여 애플리케이션 배포하기

서버리스 애플리케이션을 처음 배포하는 경우 --guided 옵션을 사용합니다. AWS SAMCLI는 애플리케이션의 배포 설정을 구성하는 대화형 흐름을 안내합니다.

대화형 흐름을 사용하여 애플리케이션을 배포하려면
  1. 프로젝트의 루트 디렉터리로 이동합니다. AWS SAM 템플릿과 같은 위치입니다.

    $ cd sam-app
  2. 다음 명령을 실행합니다:

    $ sam deploy --guided
  3. 대화형 흐름 중에 AWS SAMCLI에 애플리케이션의 배포 설정을 구성할 수 있는 옵션을 묻는 메시지가 표시됩니다.

    대괄호([ ])는 기본값을 나타냅니다. 기본값을 선택하려면 답을 비워둡니다. 기본값은 다음 구성 파일에서 가져옵니다.

    • ~/.aws/config— 일반 AWS 계정 설정.

    • ~/.aws/credentials— AWS 계정 자격 증명.

    • <project>/samconfig.toml - 프로젝트의 구성 파일.

    AWS SAMCLI 프롬프트에 응답하여 값을 제공합니다. 예를 들어, 예(yes)y, 아니요(no)n, 또는 문자열 값을 입력할 수 있습니다.

    AWS SAMCLI는 프로젝트 samconfig.toml 파일에 응답을 기록합니다. 후속 배포의 경우 sam deploy를 사용하여 이러한 구성된 값을 사용해 배포할 수 있습니다. 이러한 값을 재구성하려면 다시 sam deploy --guided를 사용하거나 직접 구성 파일을 수정합니다.

    다음은 출력의 예제입니다.

    sam-app $ sam deploy --guided Configuring SAM deploy ====================== Looking for config file [samconfig.toml] : Found Reading default arguments : Success Setting default arguments for 'sam deploy' ========================================= Stack Name [sam-app]: ENTER AWS Region [us-west-2]: ENTER #Shows you resources changes to be deployed and require a 'Y' to initiate deploy Confirm changes before deploy [Y/n]: ENTER #SAM needs permission to be able to create roles to connect to the resources in your template Allow SAM CLI IAM role creation [Y/n]: ENTER #Preserves the state of previously provisioned resources when an operation fails Disable rollback [y/N]: ENTER HelloWorldFunction may not have authorization defined, Is this okay? [y/N]: y Save arguments to configuration file [Y/n]: ENTER SAM configuration file [samconfig.toml]: ENTER SAM configuration environment [default]: ENTER
  4. 그런 다음 응용 프로그램을 에 AWS SAMCLI AWS 클라우드배포합니다. 배포하는 동안 명령 프롬프트에 진행 상황이 표시됩니다. 배포의 주요 단계는 다음과 같습니다.

    • .zip 파일 아카이브로 패키징된 AWS Lambda 함수가 있는 애플리케이션의 경우 패키지를 압축하여 AWS SAMCLI Amazon Simple Storage Service (Amazon S3) 버킷에 업로드합니다. 필요한 경우 AWS SAMCLI가 새 버킷을 생성합니다.

    • Lambda 함수가 컨테이너 이미지로 패키징되는 애플리케이션의 경우, AWS SAMCLI는 Amazon Elastic Container Registry(Amazon ECR)에 이미지를 업로드합니다. 필요한 경우 AWS SAMCLI가 새 리포지토리를 생성합니다.

    • 는 AWS CloudFormation 변경 세트를 AWS SAMCLI 생성하여 AWS CloudFormation 애플리케이션을 스택으로 배포합니다.

    • 는 Lambda 함수의 새 CodeUri 값으로 배포된 AWS SAM 템플릿을 AWS SAMCLI 수정합니다.

    다음은 AWS SAM CLI 배포의 예제입니다.

    Looking for resources needed for deployment: Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-1a4x26zbcdkqr A different default S3 bucket can be set in samconfig.toml and auto resolution of buckets turned off by setting resolve_s3=False Parameter "stack_name=sam-app" in [default.deploy.parameters] is defined as a global parameter [default.global.parameters]. This parameter will be only saved under [default.global.parameters] in /Users/.../sam-app/samconfig.toml. Saved arguments to config file Running 'sam deploy' for future deployments will use the parameters saved above. The above parameters can be changed by modifying samconfig.toml Learn more about samconfig.toml syntax at https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-config.html Uploading to sam-app-zip/da3c598813f1c2151579b73ad788cac8 262144 / 619839 (42.29%)Uploading to sam-app-zip/da3c598813f1c2151579b73ad788cac8 524288 / 619839 (84.58%)Uploading to sam-app-zip/da3c598813f1c2151579b73ad788cac8 619839 / 619839 (100.00%) Deploying with following values =============================== Stack name : sam-app Region : us-west-2 Confirm changeset : True Disable rollback : False Deployment s3 bucket : aws-sam-cli-managed-default-samclisourcebucket-1a4x26zbcdkqr Capabilities : ["CAPABILITY_IAM"] Parameter overrides : {} Signing Profiles : {} Initiating deployment ===================== Uploading to sam-app-zip/be84c20f868068e4dc4a2c11966edf2d.template 1212 / 1212 (100.00%) Waiting for changeset to be created.. CloudFormation stack changeset ------------------------------------------------------------------------------------------------- Operation LogicalResourceId ResourceType Replacement ------------------------------------------------------------------------------------------------- + Add HelloWorldFunctionHell AWS::Lambda::Permissio N/A oWorldPermissionProd n + Add HelloWorldFunctionRole AWS::IAM::Role N/A + Add HelloWorldFunction AWS::Lambda::Function N/A + Add ServerlessRestApiDeplo AWS::ApiGateway::Deplo N/A yment47fc2d5f9d yment + Add ServerlessRestApiProdS AWS::ApiGateway::Stage N/A tage + Add ServerlessRestApi AWS::ApiGateway::RestA N/A pi ------------------------------------------------------------------------------------------------- Changeset created successfully. arn:aws:cloudformation:us-west-2:012345678910:changeSet/samcli-deploy1680559234/d9f58a77-98bc-41cd-b9f4-433a5a450d7a Previewing CloudFormation changeset before deployment ====================================================== Deploy this changeset? [y/N]: y 2023-04-03 12:00:50 - Waiting for stack create/update to complete CloudFormation events from stack operations (refresh every 5.0 seconds) ------------------------------------------------------------------------------------------------- ResourceStatus ResourceType LogicalResourceId ResourceStatusReason ------------------------------------------------------------------------------------------------- CREATE_IN_PROGRESS AWS::IAM::Role HelloWorldFunctionRole - CREATE_IN_PROGRESS AWS::IAM::Role HelloWorldFunctionRole Resource creation Initiated CREATE_COMPLETE AWS::IAM::Role HelloWorldFunctionRole - CREATE_IN_PROGRESS AWS::Lambda::Function HelloWorldFunction - CREATE_IN_PROGRESS AWS::Lambda::Function HelloWorldFunction Resource creation Initiated CREATE_COMPLETE AWS::Lambda::Function HelloWorldFunction - CREATE_IN_PROGRESS AWS::ApiGateway::RestA ServerlessRestApi - pi CREATE_IN_PROGRESS AWS::ApiGateway::RestA ServerlessRestApi Resource creation pi Initiated CREATE_COMPLETE AWS::ApiGateway::RestA ServerlessRestApi - pi CREATE_IN_PROGRESS AWS::Lambda::Permissio HelloWorldFunctionHell - n oWorldPermissionProd CREATE_IN_PROGRESS AWS::ApiGateway::Deplo ServerlessRestApiDeplo - yment yment47fc2d5f9d CREATE_IN_PROGRESS AWS::Lambda::Permissio HelloWorldFunctionHell Resource creation n oWorldPermissionProd Initiated CREATE_IN_PROGRESS AWS::ApiGateway::Deplo ServerlessRestApiDeplo Resource creation yment yment47fc2d5f9d Initiated CREATE_COMPLETE AWS::ApiGateway::Deplo ServerlessRestApiDeplo - yment yment47fc2d5f9d CREATE_IN_PROGRESS AWS::ApiGateway::Stage ServerlessRestApiProdS - tage CREATE_IN_PROGRESS AWS::ApiGateway::Stage ServerlessRestApiProdS Resource creation tage Initiated CREATE_COMPLETE AWS::ApiGateway::Stage ServerlessRestApiProdS - tage CREATE_COMPLETE AWS::Lambda::Permissio HelloWorldFunctionHell - n oWorldPermissionProd CREATE_COMPLETE AWS::CloudFormation::S sam-app-zip - tack ------------------------------------------------------------------------------------------------- CloudFormation outputs from deployed stack ------------------------------------------------------------------------------------------------- Outputs ------------------------------------------------------------------------------------------------- Key HelloWorldFunctionIamRole Description Implicit IAM Role created for Hello World function Value arn:aws:iam::012345678910:role/sam-app-zip- HelloWorldFunctionRole-11ZOGSCG28H0M Key HelloWorldApi Description API Gateway endpoint URL for Prod stage for Hello World function Value https://njzfhdmls0.execute-api.us-west-2.amazonaws.com/Prod/hello/ Key HelloWorldFunction Description Hello World Lambda Function ARN Value arn:aws:lambda:us-west-2:012345678910:function:sam-app- HelloWorldFunction-XPqNX4TBu7qn ------------------------------------------------------------------------------------------------- Successfully created/updated stack - sam-app-zip in us-west-2
  5. 배포한 애플리케이션을 보려면 다음 작업을 수행합니다.

    1. https://console.aws.amazon.com/cloudformation URL을 AWS CloudFormation 사용하여 콘솔을 직접 엽니다.

    2. 스택을 선택합니다.

    3. 애플리케이션 이름으로 스택을 식별하고 선택합니다.

배포 전에 변경 사항을 확인합니다.

AWS CloudFormation 변경 세트를 표시하고 AWS SAMCLI 배포하기 전에 확인을 요청하도록 구성할 수 있습니다.

배포 전에 변경 내용을 확인하려면
  1. sam deploy --guided 중에 Y를 입력하여 배포 전에 변경 사항을 확인합니다.

    #Shows you resources changes to be deployed and require a 'Y' to initiate deploy
    Confirm changes before deploy [Y/n]: Y

    또는 다음과 같이 samconfig.toml 파일을 수정할 수 있습니다.

    [default.deploy]
    [default.deploy.parameters]
    confirm_changeset = true
  2. 배포 중에, 배포 전에 변경 사항을 확인하라는 메시지가 AWS SAMCLI에 표시됩니다. 다음은 그 예제입니다.

    Waiting for changeset to be created.. CloudFormation stack changeset ------------------------------------------------------------------------------------------------- Operation LogicalResourceId ResourceType Replacement ------------------------------------------------------------------------------------------------- + Add HelloWorldFunctionHell AWS::Lambda::Permissio N/A oWorldPermissionProd n + Add HelloWorldFunctionRole AWS::IAM::Role N/A + Add HelloWorldFunction AWS::Lambda::Function N/A + Add ServerlessRestApiDeplo AWS::ApiGateway::Deplo N/A yment47fc2d5f9d yment + Add ServerlessRestApiProdS AWS::ApiGateway::Stage N/A tage + Add ServerlessRestApi AWS::ApiGateway::RestA N/A pi ------------------------------------------------------------------------------------------------- Changeset created successfully. arn:aws:cloudformation:us-west-2:012345678910:changeSet/samcli-deploy1680559234/d9f58a77-98bc-41cd-b9f4-433a5a450d7a Previewing CloudFormation changeset before deployment ====================================================== Deploy this changeset? [y/N]: y

배포 중에 추가 파라미터 지정

배포 시 구성할 추가 파라미터 값을 지정할 수 있습니다. AWS SAM 템플릿을 수정하고 배포 중에 파라미터 값을 구성하여 이 작업을 수행할 수 있습니다.

추가 파라미터를 지정하려면
  1. AWS SAM 템플릿의 Parameters 섹션을 수정하십시오. 다음은 그 예제입니다.

    AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 ... Globals: ... Parameters: DomainName: Type: String Default: example Description: Domain name
  2. sam deploy --guided를 실행합니다. 다음은 출력의 예제입니다.

    sam-app $ sam deploy --guided Configuring SAM deploy ====================== Looking for config file [samconfig.toml] : Found Reading default arguments : Success Setting default arguments for 'sam deploy' ========================================= Stack Name [sam-app-zip]: ENTER AWS Region [us-west-2]: ENTER Parameter DomainName [example]: ENTER

Lambda 함수에 대한 코드 서명

배포 시 Lambda 함수의 코드 서명을 구성할 수 있습니다. AWS SAM 템플릿을 수정하고 배포 중에 코드 서명을 구성하면 됩니다.

코드 서명을 구성하려면
  1. CodeSigningConfigArn AWS SAM 템플릿에 지정하십시오. 다음은 그 예제입니다.

    AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 ... Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: CodeUri: hello_world/ Handler: app.lambda_handler Runtime: python3.7 CodeSigningConfigArn: arn:aws:lambda:us-east-1:111122223333:code-signing-config:csc-12e12345db1234567
  2. sam deploy --guided를 실행합니다. AWS SAMCLI에 코드 서명을 구성하라는 메시지가 표시됩니다. 다음은 출력의 예제입니다.

    #Found code signing configurations in your function definitions
    Do you want to sign your code? [Y/n]: ENTER
    #Please provide signing profile details for the following functions & layers
    #Signing profile details for function 'HelloWorld'
    Signing Profile Name: 
    Signing Profile Owner Account ID (optional):
    #Signing profile details for layer 'MyLayer', which is used by functions {'HelloWorld'}
    Signing Profile Name: 
    Signing Profile Owner Account ID (optional):

모범 사례

  • sam deploy를 사용하면 AWS SAMCLI가 .aws-sam 디렉터리에 있는 애플리케이션의 빌드 아티팩트를 배포합니다. 애플리케이션의 원본 파일을 변경하는 경우 배포하기 전에 sam build를 실행하여 .aws-sam디렉터리를 업데이트합니다.

  • 애플리케이션을 처음 배포하는 경우 sam deploy --guided를 사용하여 배포 설정을 구성합니다. 후속 배포의 경우 sam deploy를 사용하여 구성된 설정으로 배포할 수 있습니다.

sam deploy 옵션

다음은 sam deploy에 일반적으로 사용되는 옵션입니다. 콘텐츠 옵션 목록은 sam deploy 섹션을 참조하세요.

안내된 대화형 흐름을 사용하여 애플리케이션을 배포합니다.

--guided 옵션을 사용하여 대화형 흐름을 통해 애플리케이션의 배포 설정을 구성할 수 있습니다. 다음은 그 예제입니다.

$ sam deploy --guided

애플리케이션의 배포 설정은 프로젝트 samconfig.toml 파일에 저장됩니다. 자세한 내용은 프로젝트 설정 구성 섹션을 참조하세요.

문제 해결

문제를 AWS SAMCLI 해결하려면 을 참조하십시오AWS SAMCLI 문제 해결.

.zip 파일 아카이브로 패키징된 Lambda 함수를 포함하는 Hello World 애플리케이션을 배포합니다.

예제는 Hello World 애플리케이션 자습서의 3단계: 애플리케이션을 다음 위치에 배포하십시오. AWS 클라우드 섹션을 참조하세요.

컨테이너 이미지로 패키징된 Lambda 함수를 포함하는 Hello World 애플리케이션을 배포합니다.

먼저 sam init를 사용하여 Hello World 애플리케이션을 만듭니다. 대화형 흐름 중에 Python3.9 런타임과 Image 패키지 유형을 선택합니다.

$ sam init ... Which template source would you like to use? 1 - AWS Quick Start Templates 2 - Custom Template Location Choice: 1 Choose an AWS Quick Start application template 1 - Hello World Example 2 - Multi-step workflow ... Template: 1 Use the most popular runtime and package type? (Python and zip) [y/N]: ENTER Which runtime would you like to use? 1 - aot.dotnet7 (provided.al2) ... 15 - nodejs12.x 16 - python3.9 17 - python3.8 ... Runtime: 16 What package type would you like to use? 1 - Zip 2 - Image Package type: 2 Based on your selections, the only dependency manager available is pip. We will proceed copying the template using pip. ... Project name [sam-app]: ENTER ----------------------- Generating application: ----------------------- Name: sam-app Base Image: amazon/python3.9-base Architectures: x86_64 Dependency Manager: pip Output Directory: . Configuration file: sam-app/samconfig.toml Next steps can be found in the README file at sam-app/README.md ...

다음으로 프로젝트의 루트 디렉터리에 cd를 사용하여 sam build를 실행합니다. AWS SAMCLI는 Docker를 사용하여 로컬에서 Lambda 함수를 빌드합니다.

sam-app $ sam build Building codeuri: /Users/.../sam-app runtime: None metadata: {'Dockerfile': 'Dockerfile', 'DockerContext': '/Users/.../sam-app/hello_world', 'DockerTag': 'python3.9-v1'} architecture: x86_64 functions: HelloWorldFunction Building image for HelloWorldFunction function Setting DockerBuildArgs: {} for HelloWorldFunction function Step 1/5 : FROM public.ecr.aws/lambda/python:3.9 ---> 0a5e3da309aa Step 2/5 : COPY requirements.txt ./ ---> abc4e82e85f9 Step 3/5 : RUN python3.9 -m pip install -r requirements.txt -t . ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ---> Running in 43845e7aa22d Collecting requests Downloading requests-2.28.2-py3-none-any.whl (62 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 KB 829.5 kB/s eta 0:00:00 Collecting idna<4,>=2.5 Downloading idna-3.4-py3-none-any.whl (61 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 KB 2.4 MB/s eta 0:00:00 Collecting charset-normalizer<4,>=2 Downloading charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (199 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 199.2/199.2 KB 2.1 MB/s eta 0:00:00 Collecting certifi>=2017.4.17 Downloading certifi-2022.12.7-py3-none-any.whl (155 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 KB 10.2 MB/s eta 0:00:00 Collecting urllib3<1.27,>=1.21.1 Downloading urllib3-1.26.15-py2.py3-none-any.whl (140 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.9/140.9 KB 9.1 MB/s eta 0:00:00 Installing collected packages: urllib3, idna, charset-normalizer, certifi, requests Successfully installed certifi-2022.12.7 charset-normalizer-3.1.0 idna-3.4 requests-2.28.2 urllib3-1.26.15 Removing intermediate container 43845e7aa22d ---> cab8ace899ce Step 4/5 : COPY app.py ./ ---> 4146f3cd69f2 Step 5/5 : CMD ["app.lambda_handler"] ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ---> Running in f4131ddffb31 Removing intermediate container f4131ddffb31 ---> d2f5180b2154 Successfully built d2f5180b2154 Successfully tagged helloworldfunction:python3.9-v1 Build Succeeded Built Artifacts : .aws-sam/build Built Template : .aws-sam/build/template.yaml Commands you can use next ========================= [*] Validate SAM template: sam validate [*] Invoke Function: sam local invoke [*] Test Function in the Cloud: sam sync --stack-name {{stack-name}} --watch [*] Deploy: sam deploy --guided

다음으로 sam deploy --guided를 실행하여 애플리케이션을 배포합니다. AWS SAMCLI는 배포 설정을 구성하는 방법을 안내합니다. 그런 다음 애플리케이션을 에 AWS SAMCLI AWS 클라우드배포합니다.

sam-app $ sam deploy --guided Configuring SAM deploy ====================== Looking for config file [samconfig.toml] : Found Reading default arguments : Success Setting default arguments for 'sam deploy' ========================================= Stack Name [sam-app]: ENTER AWS Region [us-west-2]: ENTER #Shows you resources changes to be deployed and require a 'Y' to initiate deploy Confirm changes before deploy [Y/n]: ENTER #SAM needs permission to be able to create roles to connect to the resources in your template Allow SAM CLI IAM role creation [Y/n]: ENTER #Preserves the state of previously provisioned resources when an operation fails Disable rollback [y/N]: ENTER HelloWorldFunction may not have authorization defined, Is this okay? [y/N]: y Save arguments to configuration file [Y/n]: ENTER SAM configuration file [samconfig.toml]: ENTER SAM configuration environment [default]: ENTER Looking for resources needed for deployment: Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-1a4x26zbcdkqr A different default S3 bucket can be set in samconfig.toml and auto resolution of buckets turned off by setting resolve_s3=False Parameter "stack_name=sam-app" in [default.deploy.parameters] is defined as a global parameter [default.global.parameters]. This parameter will be only saved under [default.global.parameters] in /Users/.../sam-app/samconfig.toml. Saved arguments to config file Running 'sam deploy' for future deployments will use the parameters saved above. The above parameters can be changed by modifying samconfig.toml Learn more about samconfig.toml syntax at https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-config.html e95fc5e75742: Pushed d8df51e7bdd7: Pushed b1d0d7e0b34a: Pushed 0071317b94d8: Pushed d98f98baf147: Pushed 2d244e0816c6: Pushed eb2eeb1ebe42: Pushed a5ca065a3279: Pushed fe9e144829c9: Pushed helloworldfunction-d2f5180b2154-python3.9-v1: digest: sha256:cceb71401b47dc3007a7a1e1f2e0baf162999e0e6841d15954745ecc0c447533 size: 2206 Deploying with following values =============================== Stack name : sam-app Region : us-west-2 Confirm changeset : True Disable rollback : False Deployment image repository : { "HelloWorldFunction": "012345678910.dkr.ecr.us-west-2.amazonaws.com/samapp7427b055/helloworldfunction19d43fc4repo" } Deployment s3 bucket : aws-sam-cli-managed-default-samclisourcebucket-1a4x26zbcdkqr Capabilities : ["CAPABILITY_IAM"] Parameter overrides : {} Signing Profiles : {} Initiating deployment ===================== HelloWorldFunction may not have authorization defined. Uploading to sam-app/682ad27c7cf7a17c7f77a1688b0844f2.template 1328 / 1328 (100.00%) Waiting for changeset to be created.. CloudFormation stack changeset ------------------------------------------------------------------------------------------------- Operation LogicalResourceId ResourceType Replacement ------------------------------------------------------------------------------------------------- + Add HelloWorldFunctionHell AWS::Lambda::Permissio N/A oWorldPermissionProd n + Add HelloWorldFunctionRole AWS::IAM::Role N/A + Add HelloWorldFunction AWS::Lambda::Function N/A + Add ServerlessRestApiDeplo AWS::ApiGateway::Deplo N/A yment47fc2d5f9d yment + Add ServerlessRestApiProdS AWS::ApiGateway::Stage N/A tage + Add ServerlessRestApi AWS::ApiGateway::RestA N/A pi ------------------------------------------------------------------------------------------------- Changeset created successfully. arn:aws:cloudformation:us-west-2:012345678910:changeSet/samcli-deploy1680634124/0ffd4faf-2e2b-487e-b9e0-9116e8299ac4 Previewing CloudFormation changeset before deployment ====================================================== Deploy this changeset? [y/N]: y 2023-04-04 08:49:15 - Waiting for stack create/update to complete CloudFormation events from stack operations (refresh every 5.0 seconds) ------------------------------------------------------------------------------------------------- ResourceStatus ResourceType LogicalResourceId ResourceStatusReason ------------------------------------------------------------------------------------------------- CREATE_IN_PROGRESS AWS::CloudFormation::S sam-app User Initiated tack CREATE_IN_PROGRESS AWS::IAM::Role HelloWorldFunctionRole - CREATE_IN_PROGRESS AWS::IAM::Role HelloWorldFunctionRole Resource creation Initiated CREATE_COMPLETE AWS::IAM::Role HelloWorldFunctionRole - CREATE_IN_PROGRESS AWS::Lambda::Function HelloWorldFunction - CREATE_IN_PROGRESS AWS::Lambda::Function HelloWorldFunction Resource creation Initiated CREATE_COMPLETE AWS::Lambda::Function HelloWorldFunction - CREATE_IN_PROGRESS AWS::ApiGateway::RestA ServerlessRestApi - pi CREATE_IN_PROGRESS AWS::ApiGateway::RestA ServerlessRestApi Resource creation pi Initiated CREATE_COMPLETE AWS::ApiGateway::RestA ServerlessRestApi - pi CREATE_IN_PROGRESS AWS::Lambda::Permissio HelloWorldFunctionHell - n oWorldPermissionProd CREATE_IN_PROGRESS AWS::ApiGateway::Deplo ServerlessRestApiDeplo - yment yment47fc2d5f9d CREATE_IN_PROGRESS AWS::Lambda::Permissio HelloWorldFunctionHell Resource creation n oWorldPermissionProd Initiated CREATE_IN_PROGRESS AWS::ApiGateway::Deplo ServerlessRestApiDeplo Resource creation yment yment47fc2d5f9d Initiated CREATE_COMPLETE AWS::ApiGateway::Deplo ServerlessRestApiDeplo - yment yment47fc2d5f9d CREATE_IN_PROGRESS AWS::ApiGateway::Stage ServerlessRestApiProdS - tage CREATE_IN_PROGRESS AWS::ApiGateway::Stage ServerlessRestApiProdS Resource creation tage Initiated CREATE_COMPLETE AWS::ApiGateway::Stage ServerlessRestApiProdS - tage CREATE_COMPLETE AWS::Lambda::Permissio HelloWorldFunctionHell - n oWorldPermissionProd CREATE_COMPLETE AWS::CloudFormation::S sam-app - tack ------------------------------------------------------------------------------------------------- CloudFormation outputs from deployed stack ------------------------------------------------------------------------------------------------- Outputs ------------------------------------------------------------------------------------------------- Key HelloWorldFunctionIamRole Description Implicit IAM Role created for Hello World function Value arn:aws:iam::012345678910:role/sam-app-HelloWorldFunctionRole-JFML1JOKHJ71 Key HelloWorldApi Description API Gateway endpoint URL for Prod stage for Hello World function Value https://endlwiqqod.execute-api.us-west-2.amazonaws.com/Prod/hello/ Key HelloWorldFunction Description Hello World Lambda Function ARN Value arn:aws:lambda:us-west-2:012345678910:function:sam-app-HelloWorldFunction- kyg6Y2iNRUPg ------------------------------------------------------------------------------------------------- Successfully created/updated stack - sam-app in us-west-2

자세히 알아보기

AWS SAMCLIsam deploy명령 사용에 대한 자세한 내용은 다음을 참조하십시오.