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.

SourceConfig Struct ​

Result of binding Source into a Service.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as apprunner_alpha from '@aws-cdk/aws-apprunner-alpha';
import { aws_ecr as ecr } from 'aws-cdk-lib';

declare const gitHubConnection: apprunner_alpha.GitHubConnection;
declare const repository: ecr.Repository;
declare const runtime: apprunner_alpha.Runtime;
declare const secret: apprunner_alpha.Secret;
const sourceConfig: apprunner_alpha.SourceConfig = {
  codeRepository: {
    codeConfiguration: {
      configurationSource: apprunner_alpha.ConfigurationSourceType.REPOSITORY,

      // the properties below are optional
      configurationValues: {
        runtime: runtime,

        // the properties below are optional
        buildCommand: 'buildCommand',
        environment: {
          environmentKey: 'environment',
        },
        environmentSecrets: {
          environmentSecretsKey: secret,
        },
        environmentVariables: {
          environmentVariablesKey: 'environmentVariables',
        },
        port: 'port',
        startCommand: 'startCommand',
      },
    },
    connection: gitHubConnection,
    repositoryUrl: 'repositoryUrl',
    sourceCodeVersion: {
      type: 'type',
      value: 'value',
    },
  },
  ecrRepository: repository,
  imageRepository: {
    imageIdentifier: 'imageIdentifier',
    imageRepositoryType: apprunner_alpha.ImageRepositoryType.ECR_PUBLIC,

    // the properties below are optional
    imageConfiguration: {
      environment: {
        environmentKey: 'environment',
      },
      environmentSecrets: {
        environmentSecretsKey: secret,
      },
      environmentVariables: {
        environmentVariablesKey: 'environmentVariables',
      },
      port: 123,
      startCommand: 'startCommand',
    },
  },
};

Properties ​

codeRepositoryoptionalCodeRepositoryPropscode_repositoryoptionalCodeRepositoryPropscodeRepositoryoptionalCodeRepositoryPropsCodeRepositoryoptionalCodeRepositoryPropsCodeRepositoryoptionalCodeRepositoryProps#
The code repository configuration (mutually exclusive with `imageRepository`).

Default: no code repository.

ecrRepositoryoptionalIRepositoryecr_repositoryoptionalIRepositoryecrRepositoryoptionalIRepositoryEcrRepositoryoptionalIRepositoryEcrRepositoryoptionalIRepository#
The ECR repository (required to grant the pull privileges for the iam role).

Default: no ECR repository.

imageRepositoryoptionalImageRepositoryimage_repositoryoptionalImageRepositoryimageRepositoryoptionalImageRepositoryImageRepositoryoptionalImageRepositoryImageRepositoryoptionalImageRepository#
The image repository configuration (mutually exclusive with `codeRepository`).

Default: no image repository.