software.amazon.awscdk.services.apprunner.alpha.package-info Maven / Gradle / Ivy
Show all versions of apprunner-alpha Show documentation
/**
* AWS::AppRunner Construct Library
*
* ---
*
*
*
*
*
* All classes with the Cfn
prefix in this module (CFN Resources) are always stable and safe to use.
*
*
*
*
*
*
*
* The APIs of higher level constructs in this module are experimental and under active development.
* They are subject to non-backward compatible changes or removal in any future version. These are
* not subject to the Semantic Versioning model and breaking changes will be
* announced in the release notes. This means that while you may use them, you may need to update
* your source code when upgrading to a newer version of this package.
*
*
*
*
*
*
*
* This module is part of the AWS Cloud Development Kit project.
*
*
* // Example automatically generated. See https://github.com/aws/jsii/issues/826
* import software.amazon.awscdk.services.apprunner.*;
*
*
*
Introduction
*
* AWS App Runner is a fully managed service that makes it easy for developers to quickly deploy containerized web applications and APIs, at scale and with no prior infrastructure experience required. Start with your source code or a container image. App Runner automatically builds and deploys the web application and load balances traffic with encryption. App Runner also scales up or down automatically to meet your traffic needs. With App Runner, rather than thinking about servers or scaling, you have more time to focus on your applications.
*
*
Service
*
* The Service
construct allows you to create AWS App Runner services with ECR Public
, ECR
or Github
with the source
property in the following scenarios:
*
*
* Source.fromEcr()
- To define the source repository from ECR
.
* Source.fromEcrPublic()
- To define the source repository from ECR Public
.
* Source.fromGitHub()
- To define the source repository from the Github repository
.
* Source.fromAsset()
- To define the source from local asset directory.
*
*
*
ECR Public
*
* To create a Service
with ECR Public:
*
*
* // Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
* Service.Builder.create(stack, "Service")
* .source(Source.fromEcrPublic(Map.of(
* "imageConfiguration", Map.of("port", 8000),
* "imageIdentifier", "public.ecr.aws/aws-containers/hello-app-runner:latest")))
* .build();
*
*
*
ECR
*
* To create a Service
from an existing ECR repository:
*
*
* // Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
* Service.Builder.create(stack, "Service")
* .source(Source.fromEcr(Map.of(
* "imageConfiguration", Map.of("port", 80),
* "repository", ecr.Repository.fromRepositoryName(stack, "NginxRepository", "nginx"),
* "tag", "latest")))
* .build();
*
*
* To create a Service
from local docker image asset directory built and pushed to Amazon ECR:
*
*
* // Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
* Object imageAsset = DockerImageAsset.Builder.create(stack, "ImageAssets")
* .directory(path.join(__dirname, "./docker.assets"))
* .build();
* Service.Builder.create(stack, "Service")
* .source(Source.fromAsset(Map.of(
* "imageConfiguration", Map.of("port", 8000),
* "asset", imageAsset)))
* .build();
*
*
*
GitHub
*
* To create a Service
from the GitHub repository, you need to specify an existing App Runner Connection
.
*
* See Managing App Runner connections for more details.
*
*
* // Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
* Service.Builder.create(stack, "Service")
* .source(Source.fromGitHub(Map.of(
* "repositoryUrl", "https://github.com/aws-containers/hello-app-runner",
* "branch", "main",
* "configurationSource", ConfigurationSourceType.getREPOSITORY(),
* "connection", GitHubConnection.fromConnectionArn("CONNECTION_ARN"))))
* .build();
*
*
* Use codeConfigurationValues
to override configuration values with the API
configuration source type.
*
*
* // Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
* Service.Builder.create(stack, "Service")
* .source(Source.fromGitHub(Map.of(
* "repositoryUrl", "https://github.com/aws-containers/hello-app-runner",
* "branch", "main",
* "configurationSource", ConfigurationSourceType.getAPI(),
* "codeConfigurationValues", Map.of(
* "runtime", Runtime.getPYTHON_3(),
* "port", "8000",
* "startCommand", "python app.py",
* "buildCommand", "yum install -y pycairo && pip install -r requirements.txt"),
* "connection", GitHubConnection.fromConnectionArn("CONNECTION_ARN"))))
* .build();
*
*
*
IAM Roles
*
* You are allowed to define instanceRole
and accessRole
for the Service
.
*
* instanceRole
- The IAM role that provides permissions to your App Runner service. These are permissions that
* your code needs when it calls any AWS APIs.
*
* accessRole
- The IAM role that grants the App Runner service access to a source repository. It's required for
* ECR image repositories (but not for ECR Public repositories). If not defined, a new access role will be generated
* when required.
*
* See App Runner IAM Roles for more details.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
package software.amazon.awscdk.services.apprunner.alpha;