Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. AWS
기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
를 사용한 App Runner 예제 AWS CLI
다음 코드 예제에서는 App Runner와 AWS Command Line Interface 함께를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.
작업은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 관련 시나리오의 컨텍스트에 따라 표시되며, 개별 서비스 함수를 직접적으로 호출하는 방법을 보여줍니다.
각 예시에는 전체 소스 코드에 대한 링크가 포함되어 있으며, 여기에서 컨텍스트에 맞춰 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있습니다.
주제
작업
다음 코드 예시에서는 associate-custom-domain
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
도메인 이름과 www 하위 도메인을 서비스에 연결하는 방법
다음
associate-custom-domain
예제에서는 사용자가 제어하는 사용자 지정 도메인 이름을 App Runner 서비스와 연결합니다. 도메인 이름은 특수 사례 하위 도메인www.example.com
을 포함하는 루트 도메인example.com
입니다.aws apprunner associate-custom-domain \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "DomainName": "example.com", "EnableWWWSubdomain": true }
출력:
{ "CustomDomain": { "CertificateValidationRecords": [ { "Name": "_70d3f50a94f7c72dc28784cf55db2f6b.example.com", "Status": "PENDING_VALIDATION", "Type": "CNAME", "Value": "_1270c137383c6307b6832db02504c4b0.bsgbmzkfwj.acm-validations.aws." }, { "Name": "_287870d3f50a94f7c72dc4cf55db2f6b.www.example.com", "Status": "PENDING_VALIDATION", "Type": "CNAME", "Value": "_832db01270c137383c6307b62504c4b0.mzkbsgbfwj.acm-validations.aws." } ], "DomainName": "example.com", "EnableWWWSubdomain": true, "Status": "CREATING" }, "DNSTarget": "psbqam834h.us-east-1.awsapprunner.com", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa" }
-
API 세부 정보는 AWS CLI 명령 참조의 AssociateCustomDomain
을 참조하세요.
-
다음 코드 예시에서는 create-auto-scaling-configuration
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
고가용성 오토 스케일링 구성을 생성하는 방법
다음
create-auto-scaling-configuration
예제에서는MinSize
를 5로 설정하여 고가용성에 최적화된 오토 스케일링 구성을 생성합니다. 이 구성을 사용하면 App Runner는 AWS 리전에 따라 최대 5개까지 가능한 대부분의 가용 영역에 서비스 인스턴스를 분산하려고 시도합니다.이 호출은
AutoScalingConfiguration
객체를 반환하며 다른 설정들은 그 각자의 기본값으로 설정됩니다. 이 예제에서는 이 호출이high-availability
라는 이름의 구성을 생성하기 위한 첫 번째 호출입니다. 개정은 1로 설정되며 이는 최신 개정입니다.aws apprunner create-auto-scaling-configuration \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "AutoScalingConfigurationName": "high-availability", "MinSize": 5 }
출력:
{ "AutoScalingConfiguration": { "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/1/2f50e7656d7819fead0f59672e68042e", "AutoScalingConfigurationName": "high-availability", "AutoScalingConfigurationRevision": 1, "CreatedAt": "2020-11-03T00:29:17Z", "Latest": true, "Status": "ACTIVE", "MaxConcurrency": 100, "MaxSize": 50, "MinSize": 5 } }
-
API 세부 정보는 AWS CLI 명령 참조의 CreateAutoScalingConfiguration
을 참조하세요.
-
다음 코드 예시에서는 create-connection
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
GitHub 연결을 생성하는 방법
다음
create-connection
예제에서는 프라이빗 GitHub 코드 리포지토리에 대한 연결을 생성합니다. 성공적인 호출 후 연결 상태는PENDING_HANDSHAKE
입니다. 이는 공급자와의 인증 핸드셰이크가 아직 발생하지 않았기 때문입니다. App Runner 콘솔을 사용하여 핸드셰이크를 완료합니다.aws apprunner create-connection \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ConnectionName": "my-github-connection", "ProviderType": "GITHUB" }
출력:
{ "Connection": { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection", "ConnectionName": "my-github-connection", "Status": "PENDING_HANDSHAKE", "CreatedAt": "2020-11-03T00:32:51Z", "ProviderType": "GITHUB" } }
자세한 내용은 AWS App Runner 개발자 안내서의 App Runner 연결 관리를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateConnection
을 참조하세요.
-
다음 코드 예시에서는 create-service
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
예제 1: 소스 코드 리포지토리 서비스를 생성하는 방법
다음
create-service
예제에서는 Python 소스 코드 리포지토리를 기반으로 App Runner 서비스를 생성합니다.aws apprunner create-service \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceName": "python-app", "SourceConfiguration": { "AuthenticationConfiguration": { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e" }, "AutoDeploymentsEnabled": true, "CodeRepository": { "RepositoryUrl": "https://github.com/my-account/python-hello", "SourceCodeVersion": { "Type": "BRANCH", "Value": "main" }, "CodeConfiguration": { "ConfigurationSource": "API", "CodeConfigurationValues": { "Runtime": "PYTHON_3", "BuildCommand": "pip install -r requirements.txt", "StartCommand": "python server.py", "Port": "8080", "RuntimeEnvironmentVariables": [ { "NAME": "Jane" } ] } } } }, "InstanceConfiguration": { "CPU": "1 vCPU", "Memory": "3 GB" } }
출력:
{ "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf", "Service": { "CreatedAt": "2020-11-20T19:05:25Z", "UpdatedAt": "2020-11-20T19:05:25Z", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa", "ServiceName": "python-app", "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com", "SourceConfiguration": { "AuthenticationConfiguration": { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e" }, "AutoDeploymentsEnabled": true, "CodeRepository": { "CodeConfiguration": { "CodeConfigurationValues": { "BuildCommand": "pip install -r requirements.txt", "Port": "8080", "Runtime": "PYTHON_3", "RuntimeEnvironmentVariables": [ { "NAME": "Jane" } ], "StartCommand": "python server.py" }, "ConfigurationSource": "Api" }, "RepositoryUrl": "https://github.com/my-account/python-hello", "SourceCodeVersion": { "Type": "BRANCH", "Value": "main" } } }, "Status": "OPERATION_IN_PROGRESS", "InstanceConfiguration": { "CPU": "1 vCPU", "Memory": "3 GB" } } }
예제 2: 소스 코드 리포지토리 서비스를 생성하는 방법
다음
create-service
예제에서는 Python 소스 코드 리포지토리를 기반으로 App Runner 서비스를 생성합니다.aws apprunner create-service \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceName": "python-app", "SourceConfiguration": { "AuthenticationConfiguration": { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e" }, "AutoDeploymentsEnabled": true, "CodeRepository": { "RepositoryUrl": "https://github.com/my-account/python-hello", "SourceCodeVersion": { "Type": "BRANCH", "Value": "main" }, "CodeConfiguration": { "ConfigurationSource": "API", "CodeConfigurationValues": { "Runtime": "PYTHON_3", "BuildCommand": "pip install -r requirements.txt", "StartCommand": "python server.py", "Port": "8080", "RuntimeEnvironmentVariables": [ { "NAME": "Jane" } ] } } } }, "InstanceConfiguration": { "CPU": "1 vCPU", "Memory": "3 GB" } }
출력:
{ "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf", "Service": { "CreatedAt": "2020-11-20T19:05:25Z", "UpdatedAt": "2020-11-20T19:05:25Z", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa", "ServiceName": "python-app", "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com", "SourceConfiguration": { "AuthenticationConfiguration": { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e" }, "AutoDeploymentsEnabled": true, "CodeRepository": { "CodeConfiguration": { "CodeConfigurationValues": { "BuildCommand": "pip install -r requirements.txt", "Port": "8080", "Runtime": "PYTHON_3", "RuntimeEnvironmentVariables": [ { "NAME": "Jane" } ], "StartCommand": "python server.py" }, "ConfigurationSource": "Api" }, "RepositoryUrl": "https://github.com/my-account/python-hello", "SourceCodeVersion": { "Type": "BRANCH", "Value": "main" } } }, "Status": "OPERATION_IN_PROGRESS", "InstanceConfiguration": { "CPU": "1 vCPU", "Memory": "3 GB" } } }
예제 3: 소스 이미지 리포지토리 서비스를 생성하는 방법
다음
create-service
예제에서는 Elastic Container Registry(ECR)에 저장된 이미지를 기반으로 App Runner 서비스를 생성합니다.aws apprunner create-service \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceName": "golang-container-app", "SourceConfiguration": { "AuthenticationConfiguration": { "AccessRoleArn": "arn:aws:iam::123456789012:role/my-ecr-role" }, "AutoDeploymentsEnabled": true, "ImageRepository": { "ImageIdentifier": "123456789012.dkr.ecr.us-east-1.amazonaws.com/golang-app:latest", "ImageConfiguration": { "Port": "8080", "RuntimeEnvironmentVariables": [ { "NAME": "Jane" } ] }, "ImageRepositoryType": "ECR" } }, "InstanceConfiguration": { "CPU": "1 vCPU", "Memory": "3 GB" } }
출력:
{ "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf", "Service": { "CreatedAt": "2020-11-06T23:15:30Z", "UpdatedAt": "2020-11-06T23:15:30Z", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/golang-container-app/51728f8a20ce46d39b25398a6c8e9d1a", "ServiceId": "51728f8a20ce46d39b25398a6c8e9d1a", "ServiceName": "golang-container-app", "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com", "SourceConfiguration": { "AuthenticationConfiguration": { "AccessRoleArn": "arn:aws:iam::123456789012:role/my-ecr-role" }, "AutoDeploymentsEnabled": true, "ImageRepository": { "ImageIdentifier": "123456789012.dkr.ecr.us-east-1.amazonaws.com/golang-app:latest", "ImageConfiguration": { "Port": "8080", "RuntimeEnvironmentVariables": [ { "NAME": "Jane" } ] }, "ImageRepositoryType": "ECR" } }, "Status": "OPERATION_IN_PROGRESS", "InstanceConfiguration": { "CPU": "1 vCPU", "Memory": "3 GB" } } }
-
API 세부 정보는 AWS CLI 명령 참조의 CreateService
를 참조하세요.
-
다음 코드 예시에서는 delete-auto-scaling-configuration
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
예제 1: 오토 스케일링 구성의 최신 활성 개정을 삭제하는 방법
다음
delete-auto-scaling-configuration
예제에서는 App Runner 오토 스케일링 구성의 최신 활성 개정을 삭제합니다. 최신 활성 개정을 삭제하려면 개정 구성 요소 없이 구성 이름으로 끝나는 Amazon 리소스 이름(ARN)을 지정합니다.이 예제에서는 이 작업 앞에 두 가지 개정이 있습니다. 따라서 개정 2(최신)가 삭제됩니다. 하지만 이제
"Latest": false
가 표시됩니다. 삭제된 후에는 더 이상 최신 활성 개정이 아니기 때문입니다.aws apprunner delete-auto-scaling-configuration \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability" }
출력:
{ "AutoScalingConfiguration": { "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/2/e76562f50d78042e819fead0f59672e6", "AutoScalingConfigurationName": "high-availability", "AutoScalingConfigurationRevision": 2, "CreatedAt": "2021-02-25T17:42:59Z", "DeletedAt": "2021-03-02T08:07:06Z", "Latest": false, "Status": "INACTIVE", "MaxConcurrency": 30, "MaxSize": 90, "MinSize": 5 } }
예제 2: 오토 스케일링 구성의 특정 개정을 삭제하는 방법
다음
delete-auto-scaling-configuration
예제에서는 App Runner 오토 스케일링 구성의 특정 개정을 삭제합니다. 특정 개정을 삭제하려면 개정 번호가 포함된 ARN을 지정합니다.이 예제에서는 이 작업 앞에 여러 개정이 있습니다. 이 작업은 개정
1
을 삭제합니다.aws apprunner delete-auto-scaling-configuration \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/1" }
출력:
{ "AutoScalingConfiguration": { "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/1/2f50e7656d7819fead0f59672e68042e", "AutoScalingConfigurationName": "high-availability", "AutoScalingConfigurationRevision": 1, "CreatedAt": "2020-11-03T00:29:17Z", "DeletedAt": "2021-03-02T08:07:06Z", "Latest": false, "Status": "INACTIVE", "MaxConcurrency": 100, "MaxSize": 50, "MinSize": 5 } }
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteAutoScalingConfiguration
을 참조하세요.
-
다음 코드 예시에서는 delete-connection
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
연결을 삭제하는 방법
다음
delete-connection
예제에서는 App Runner 연결을 삭제합니다. 성공적인 호출 후 연결 상태는DELETED
입니다. 이는 연결을 더 이상 사용할 수 없기 때문입니다.aws apprunner delete-connection \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection" }
출력:
{ "Connection": { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection", "ConnectionName": "my-github-connection", "Status": "DELETED", "CreatedAt": "2020-11-03T00:32:51Z", "ProviderType": "GITHUB" } }
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteConnection
섹션을 참조하세요.
-
다음 코드 예시에서는 delete-service
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
서비스 삭제
다음
delete-service
예제에서는 App Runner 서비스를 삭제합니다.aws apprunner delete-service \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa" }
출력:
{ "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf", "Service": { "CreatedAt": "2020-11-20T19:05:25Z", "UpdatedAt": "2020-11-20T19:05:25Z", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa", "ServiceName": "python-app", "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com", "SourceConfiguration": { "AuthenticationConfiguration": { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e" }, "AutoDeploymentsEnabled": true, "CodeRepository": { "CodeConfiguration": { "CodeConfigurationValues": { "BuildCommand": "pip install -r requirements.txt", "Port": "8080", "Runtime": "PYTHON_3", "RuntimeEnvironmentVariables": [ { "NAME": "Jane" } ], "StartCommand": "python server.py" }, "ConfigurationSource": "Api" }, "RepositoryUrl": "https://github.com/my-account/python-hello", "SourceCodeVersion": { "Type": "BRANCH", "Value": "main" } } }, "Status": "OPERATION_IN_PROGRESS", "InstanceConfiguration": { "CPU": "1 vCPU", "Memory": "3 GB" } } }
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteService
를 참조하세요.
-
다음 코드 예시에서는 describe-auto-scaling-configuration
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
예제 1: 오토 스케일링 구성의 최신 활성 개정을 설명하는 방법
다음
describe-auto-scaling-configuration
예제에서는 App Runner 오토 스케일링 구성의 최신 활성 개정의 설명을 가져옵니다. 최신 활성 개정을 설명하려면 개정 구성 요소 없이 구성 이름으로 끝나는 ARN을 지정합니다.이 예제에서는 두 가지 개정이 있습니다. 따라서 개정
2
(최신)가 설명됩니다. 결과 객체는"Latest": true
를 표시합니다.aws apprunner describe-auto-scaling-configuration \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability" }
출력:
{ "AutoScalingConfiguration": { "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/2/e76562f50d78042e819fead0f59672e6", "AutoScalingConfigurationName": "high-availability", "AutoScalingConfigurationRevision": 2, "CreatedAt": "2021-02-25T17:42:59Z", "Latest": true, "Status": "ACTIVE", "MaxConcurrency": 30, "MaxSize": 90, "MinSize": 5 } }
예제 2: 오토 스케일링 구성의 특정 개정을 설명하는 방법
다음
describe-auto-scaling-configuration
예제에서는 App Runner 오토 스케일링 구성의 특정 개정의 설명을 가져옵니다. 특정 개정을 설명하려면 개정 번호가 포함된 ARN을 지정합니다.이 예제에서는 여러 개정이 존재하고 개정
1
이 쿼리됩니다. 결과 객체는"Latest": false
를 표시합니다.aws apprunner describe-auto-scaling-configuration \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/1" }
출력:
{ "AutoScalingConfiguration": { "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/1/2f50e7656d7819fead0f59672e68042e", "AutoScalingConfigurationName": "high-availability", "AutoScalingConfigurationRevision": 1, "CreatedAt": "2020-11-03T00:29:17Z", "Latest": false, "Status": "ACTIVE", "MaxConcurrency": 100, "MaxSize": 50, "MinSize": 5 } }
-
API 세부 정보는 AWS CLI 명령 참조의 DescribeAutoScalingConfiguration
을 참조하세요.
-
다음 코드 예시에서는 describe-custom-domains
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
서비스와 연결된 사용자 지정 도메인 이름의 설명을 가져오는 방법
다음
describe-custom-domains
예제에서는 App Runner 서비스와 연결된 사용자 지정 도메인 이름의 설명과 상태를 가져옵니다.aws apprunner describe-custom-domains \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "DomainName": "example.com", "EnableWWWSubdomain": true }
출력:
{ "CustomDomains": [ { "CertificateValidationRecords": [ { "Name": "_70d3f50a94f7c72dc28784cf55db2f6b.example.com", "Status": "PENDING_VALIDATION", "Type": "CNAME", "Value": "_1270c137383c6307b6832db02504c4b0.bsgbmzkfwj.acm-validations.aws." }, { "Name": "_287870d3f50a94f7c72dc4cf55db2f6b.www.example.com", "Status": "PENDING_VALIDATION", "Type": "CNAME", "Value": "_832db01270c137383c6307b62504c4b0.mzkbsgbfwj.acm-validations.aws." } ], "DomainName": "example.com", "EnableWWWSubdomain": true, "Status": "PENDING_CERTIFICATE_DNS_VALIDATION" }, { "CertificateValidationRecords": [ { "Name": "_a94f784c70d3f507c72dc28f55db2f6b.deals.example.com", "Status": "SUCCESS", "Type": "CNAME", "Value": "_2db02504c1270c137383c6307b6834b0.bsgbmzkfwj.acm-validations.aws." } ], "DomainName": "deals.example.com", "EnableWWWSubdomain": false, "Status": "ACTIVE" } ], "DNSTarget": "psbqam834h.us-east-1.awsapprunner.com", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa" }
-
API 세부 정보는 AWS CLI 명령 참조의 DescribeCustomDomains
를 참조하세요.
-
다음 코드 예시에서는 describe-service
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
서비스를 설명하는 방법
다음
describe-service
예제에서는 App Runner 서비스의 설명을 가져옵니다.aws apprunner describe-service \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa" }
출력:
{ "Service": { "CreatedAt": "2020-11-20T19:05:25Z", "UpdatedAt": "2020-11-20T19:05:25Z", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa", "ServiceName": "python-app", "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com", "SourceConfiguration": { "AuthenticationConfiguration": { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e" }, "AutoDeploymentsEnabled": true, "CodeRepository": { "CodeConfiguration": { "CodeConfigurationValues": { "BuildCommand": "pip install -r requirements.txt", "Port": "8080", "Runtime": "PYTHON_3", "RuntimeEnvironmentVariables": [ { "NAME": "Jane" } ], "StartCommand": "python server.py" }, "ConfigurationSource": "Api" }, "RepositoryUrl": "https://github.com/my-account/python-hello", "SourceCodeVersion": { "Type": "BRANCH", "Value": "main" } } }, "Status": "RUNNING", "InstanceConfiguration": { "CPU": "1 vCPU", "Memory": "3 GB" } } }
-
API 세부 정보는 AWS CLI 명령 참조의 DescribeService
를 참조하세요.
-
다음 코드 예시에서는 disassociate-custom-domain
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
서비스에서 도메인 이름의 연결을 해제하는 방법
다음
disassociate-custom-domain
예제에서는 App Runner 서비스에서 도메인example.com
의 연결을 해제합니다. 이 호출은 루트 도메인과 함께 연결된 하위 도메인www.example.com
의 연결도 해제합니다.aws apprunner disassociate-custom-domain \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "DomainName": "example.com" }
출력:
{ "CustomDomain": { "CertificateValidationRecords": [ { "Name": "_70d3f50a94f7c72dc28784cf55db2f6b.example.com", "Status": "PENDING_VALIDATION", "Type": "CNAME", "Value": "_1270c137383c6307b6832db02504c4b0.bsgbmzkfwj.acm-validations.aws." }, { "Name": "_287870d3f50a94f7c72dc4cf55db2f6b.www.example.com", "Status": "PENDING_VALIDATION", "Type": "CNAME", "Value": "_832db01270c137383c6307b62504c4b0.mzkbsgbfwj.acm-validations.aws." } ], "DomainName": "example.com", "EnableWWWSubdomain": true, "Status": "DELETING" }, "DNSTarget": "psbqam834h.us-east-1.awsapprunner.com", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa" }
-
API 세부 정보는 AWS CLI 명령 참조의 DisassociateCustomDomain
을 참조하세요.
-
다음 코드 예시에서는 list-auto-scaling-configurations
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
App Runner 오토 스케일링 구성의 페이지 매긴 목록을 가져오는 방법
다음
list-auto-scaling-configurations
예제에서는 AWS 계정의 모든 App Runner Auto Scaling 구성을 나열합니다. 각 응답에서 오토 스케일링 구성이 최대 다섯 개까지 나열됩니다.AutoScalingConfigurationName
및LatestOnly
는 지정되지 않습니다. 그 기본값들로 인해 모든 활성 구성의 최신 개정이 나열됩니다.이 예제에서는 응답에 두 개의 결과가 포함되며 추가 결과가 없으므로
NextToken
이 반환되지 않습니다.aws apprunner list-auto-scaling-configurations \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "MaxResults": 5 }
출력:
{ "AutoScalingConfigurationSummaryList": [ { "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/2/e76562f50d78042e819fead0f59672e6", "AutoScalingConfigurationName": "high-availability", "AutoScalingConfigurationRevision": 2 }, { "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/low-cost/1/50d7804e7656fead0f59672e62f2e819", "AutoScalingConfigurationName": "low-cost", "AutoScalingConfigurationRevision": 1 } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 ListAutoScalingConfigurations
를 참조하세요.
-
다음 코드 예시에서는 list-connections
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
예제 1: 모든 연결을 나열하는 방법
다음
list-connections
예제에서는 AWS 계정의 모든 App Runner 연결을 나열합니다.aws apprunner list-connections
출력:
{ "ConnectionSummaryList": [ { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection", "ConnectionName": "my-github-connection", "Status": "AVAILABLE", "CreatedAt": "2020-11-03T00:32:51Z", "ProviderType": "GITHUB" }, { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-org-connection", "ConnectionName": "my-github-org-connection", "Status": "AVAILABLE", "CreatedAt": "2020-11-03T02:54:17Z", "ProviderType": "GITHUB" } ] }
예제 2: 연결을 이름별로 나열하는 방법
다음
list-connections
예제에서는 연결을 이름별로 나열합니다.aws apprunner list-connections \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ConnectionName": "my-github-org-connection" }
출력:
{ "ConnectionSummaryList": [ { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-org-connection", "ConnectionName": "my-github-org-connection", "Status": "AVAILABLE", "CreatedAt": "2020-11-03T02:54:17Z", "ProviderType": "GITHUB" } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 ListConnections
를 참조하세요.
-
다음 코드 예시에서는 list-operations
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
서비스에서 발생한 작업을 나열하는 방법
다음
list-operations
예제에서는 지금까지 App Runner 서비스에서 발생한 모든 작업을 나열합니다. 이 예제에서는 서비스가 새 서비스이며 단일 작업 유형인CREATE_SERVICE
만 발생했습니다.aws apprunner list-operations \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa" }
출력:
{ "OperationSummaryList": [ { "EndedAt": 1606156217, "Id": "17fe9f55-7e91-4097-b243-fcabbb69a4cf", "StartedAt": 1606156014, "Status": "SUCCEEDED", "TargetArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "Type": "CREATE_SERVICE", "UpdatedAt": 1606156217 } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 ListOperations
섹션을 참조하세요.
-
다음 코드 예시에서는 list-services
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
App Runner 서비스의 페이지 매긴 목록을 가져오는 방법
다음
list-services
예제에서는 AWS 계정의 모든 App Runner 서비스를 나열합니다. 각 응답에 서비스가 최대 두 개까지 나열됩니다. 이 예제는 첫 번째 요청을 보여줍니다. 응답에는 두 개의 결과와 다음 요청에 사용할 수 있는 토큰이 포함됩니다. 후속 응답에 토큰이 포함되지 않으면 모든 서비스가 나열됩니다.aws apprunner list-services \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "MaxResults": 2 }
출력:
{ "NextToken": "eyJDdXN0b21lckFjY291bnRJZCI6IjI3MDIwNTQwMjg0NSIsIlNlcnZpY2VTdGF0dXNDb2RlIjoiUFJPVklTSU9OSU5HIiwiSGFzaEtleSI6IjI3MDIwNTQwMjg0NSNhYjhmOTRjZmUyOWE0NjBmYjg3NjBhZmQyZWU4NzU1NSJ9", "ServiceSummaryList": [ { "CreatedAt": "2020-11-20T19:05:25Z", "UpdatedAt": "2020-11-23T12:41:37Z", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa", "ServiceName": "python-app", "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com", "Status": "RUNNING" }, { "CreatedAt": "2020-11-06T23:15:30Z", "UpdatedAt": "2020-11-23T13:21:22Z", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/golang-container-app/ab8f94cfe29a460fb8760afd2ee87555", "ServiceId": "ab8f94cfe29a460fb8760afd2ee87555", "ServiceName": "golang-container-app", "ServiceUrl": "e2m8rrrx33.us-east-1.awsapprunner.com", "Status": "RUNNING" } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 ListServices
를 참조하세요.
-
다음 코드 예시에서는 list-tags-for-resource
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
App Runner 서비스와 연결된 태그를 나열하는 방법
다음
list-tags-for-resource
예제에서는 App Runner 서비스와 연결된 모든 태그를 나열합니다.aws apprunner list-tags-for-resource \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ResourceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa" }
출력:
{ "Tags": [ { "Key": "Department", "Value": "Retail" }, { "Key": "CustomerId", "Value": "56439872357912" } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 ListTagsForResource
섹션을 참조하세요.
-
다음 코드 예시에서는 pause-service
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
서비스를 일시 중지하는 방법
다음
pause-service
예제에서는 App Runner 서비스를 일시 중지합니다.aws apprunner pause-service \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa" }
출력:
{ "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf", "Service": { "CreatedAt": "2020-11-20T19:05:25Z", "UpdatedAt": "2020-11-23T12:41:37Z", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa", "ServiceName": "python-app", "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com", "SourceConfiguration": { "AuthenticationConfiguration": { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e" }, "AutoDeploymentsEnabled": true, "CodeRepository": { "CodeConfiguration": { "CodeConfigurationValues": { "BuildCommand": "pip install -r requirements.txt", "Port": "8080", "Runtime": "PYTHON_3", "RuntimeEnvironmentVariables": [ { "NAME": "Jane" } ], "StartCommand": "python server.py" }, "ConfigurationSource": "Api" }, "RepositoryUrl": "https://github.com/my-account/python-hello", "SourceCodeVersion": { "Type": "BRANCH", "Value": "main" } } }, "Status": "OPERATION_IN_PROGRESS", "InstanceConfiguration": { "CPU": "1 vCPU", "Memory": "3 GB" } } }
-
API 세부 정보는 AWS CLI 명령 참조의 PauseService
를 참조하세요.
-
다음 코드 예시에서는 resume-service
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
서비스를 재개하는 방법
다음
resume-service
예제에서는 App Runner 서비스를 재개합니다.aws apprunner resume-service \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa" }
출력:
{ "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf", "Service": { "CreatedAt": "2020-11-20T19:05:25Z", "UpdatedAt": "2020-11-23T12:41:37Z", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa", "ServiceName": "python-app", "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com", "SourceConfiguration": { "AuthenticationConfiguration": { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e" }, "AutoDeploymentsEnabled": true, "CodeRepository": { "CodeConfiguration": { "CodeConfigurationValues": { "BuildCommand": "pip install -r requirements.txt", "Port": "8080", "Runtime": "PYTHON_3", "RuntimeEnvironmentVariables": [ { "NAME": "Jane" } ], "StartCommand": "python server.py" }, "ConfigurationSource": "Api" }, "RepositoryUrl": "https://github.com/my-account/python-hello", "SourceCodeVersion": { "Type": "BRANCH", "Value": "main" } } }, "Status": "OPERATION_IN_PROGRESS", "InstanceConfiguration": { "CPU": "1 vCPU", "Memory": "3 GB" } } }
-
API 세부 정보는 AWS CLI 명령 참조의 ResumeService
를 참조하세요.
-
다음 코드 예시에서는 start-deployment
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
수동 배포를 시작하는 방법
다음
start-deployment
예제에서는 App Runner 서비스에 대한 수동 배포를 수행합니다.aws apprunner start-deployment \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa" }
출력:
{ "OperationId": "853a7d5b-fc9f-4730-831b-fd8037ab832a" }
-
API 세부 정보는 AWS CLI 명령 참조의 StartDeployment
를 참조하세요.
-
다음 코드 예시에서는 tag-resource
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
App Runner 서비스에 태그를 추가하는 방법
다음
tag-resource
예제에서는 App Runner 서비스에 두 개의 태그를 추가합니다.aws apprunner tag-resource \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ResourceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "Tags": [ { "Key": "Department", "Value": "Retail" }, { "Key": "CustomerId", "Value": "56439872357912" } ] }
이 명령은 출력을 생성하지 않습니다.
-
API 세부 정보는 AWS CLI 명령 참조의 TagResource
를 참조하세요.
-
다음 코드 예시에서는 untag-resource
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
App Runner 서비스에서 태그를 제거하는 방법
다음
untag-resource
예제에서는 App Runner 서비스에서 두 개의 태그를 제거합니다.aws apprunner untag-resource \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ResourceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "TagKeys": [ "Department", "CustomerId" ] }
이 명령은 출력을 생성하지 않습니다.
-
API 세부 정보는 AWS CLI 명령 참조의 UntagResource
를 참조하세요.
-
다음 코드 예시에서는 update-service
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
메모리 크기를 업데이트하는 방법
다음
update-service
예제에서는 App Runner 서비스 인스턴스(스케일링 단위)의 메모리 크기를 2048MiB 로 업데이트합니다.호출이 성공하면 App Runner는 비동기 업데이트 프로세스를 시작합니다. 호출에 의해 반환되는
Service
구조는 이 호출이 적용하는 새 메모리 값을 반영합니다.aws apprunner update-service \ --cli-input-json
file://input.json
input.json
의 콘텐츠:{ "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "InstanceConfiguration": { "Memory": "4 GB" } }
출력:
{ "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf", "Service": { "CreatedAt": "2020-11-20T19:05:25Z", "UpdatedAt": "2020-11-23T12:41:37Z", "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa", "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa", "ServiceName": "python-app", "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com", "SourceConfiguration": { "AuthenticationConfiguration": { "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e" }, "AutoDeploymentsEnabled": true, "CodeRepository": { "CodeConfiguration": { "CodeConfigurationValues": { "BuildCommand": "pip install -r requirements.txt", "Port": "8080", "Runtime": "PYTHON_3", "RuntimeEnvironmentVariables": [ { "NAME": "Jane" } ], "StartCommand": "python server.py" }, "ConfigurationSource": "Api" }, "RepositoryUrl": "https://github.com/my-account/python-hello", "SourceCodeVersion": { "Type": "BRANCH", "Value": "main" } } }, "Status": "OPERATION_IN_PROGRESS", "InstanceConfiguration": { "CPU": "1 vCPU", "Memory": "4 GB" } } }
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateService
를 참조하세요.
-