Skip to content
v2.274.0

Experimental

@aws-cdk/aws-apprunner-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

Source Class ​

Represents the App Runner service source.

Example ​

ts
import * as iam from 'aws-cdk-lib/aws-iam';

const service = new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: { port: 8000 },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  }),
});

service.addToRolePolicy(new iam.PolicyStatement({
  effect: iam.Effect.ALLOW,
  actions: ['s3:GetObject'],
  resources: ['*'],
}))

Initializer ​

ts
new Source()
python
Source()
java
new Source()
csharp
new Source()
go
NewSource()

Methods ​

bind(scope: Construct): SourceConfigdef bind(self, scope: Construct) -> SourceConfigpublic SourceConfig bind(Construct scope)public SourceConfig Bind(Construct scope)func Bind(Scope Construct) SourceConfig#
Called when the Job is initialized to allow this object to bind.
fromAsset(props: AssetProps): AssetSource@staticmethod def from_asset(props: AssetProps) -> AssetSourcepublic static AssetSource fromAsset(AssetProps props)public static AssetSource FromAsset(AssetProps props)func FromAsset(Props AssetProps) AssetSourcestatic#
Source from local assets.
fromEcr(props: EcrProps): EcrSource@staticmethod def from_ecr(props: EcrProps) -> EcrSourcepublic static EcrSource fromEcr(EcrProps props)public static EcrSource FromEcr(EcrProps props)func FromEcr(Props EcrProps) EcrSourcestatic#
Source from the ECR repository.
fromEcrPublic(props: EcrPublicProps): EcrPublicSource@staticmethod def from_ecr_public(props: EcrPublicProps) -> EcrPublicSourcepublic static EcrPublicSource fromEcrPublic(EcrPublicProps props)public static EcrPublicSource FromEcrPublic(EcrPublicProps props)func FromEcrPublic(Props EcrPublicProps) EcrPublicSourcestatic#
Source from the ECR Public repository.
fromGitHub(props: GithubRepositoryProps): GithubSource@staticmethod def from_git_hub(props: GithubRepositoryProps) -> GithubSourcepublic static GithubSource fromGitHub(GithubRepositoryProps props)public static GithubSource FromGitHub(GithubRepositoryProps props)func FromGitHub(Props GithubRepositoryProps) GithubSourcestatic#
Source from the GitHub repository.