Skip to content
v2.274.0

CodeRepositoryProperty Struct ​

Describes a source code repository.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apprunner as apprunner } from 'aws-cdk-lib';
const codeRepositoryProperty: apprunner.CfnService.CodeRepositoryProperty = {
  repositoryUrl: 'repositoryUrl',
  sourceCodeVersion: {
    type: 'type',
    value: 'value',
  },

  // the properties below are optional
  codeConfiguration: {
    configurationSource: 'configurationSource',

    // the properties below are optional
    codeConfigurationValues: {
      runtime: 'runtime',

      // the properties below are optional
      buildCommand: 'buildCommand',
      port: 'port',
      runtimeEnvironmentSecrets: [{
        name: 'name',
        value: 'value',
      }],
      runtimeEnvironmentVariables: [{
        name: 'name',
        value: 'value',
      }],
      startCommand: 'startCommand',
    },
  },
  sourceDirectory: 'sourceDirectory',
};

Properties ​

codeConfigurationoptionalIResolvable | CfnService.CodeConfigurationPropertycode_configurationoptionaltyping.Union[IResolvable, CodeConfigurationProperty]codeConfigurationoptionalIResolvableCodeConfigurationoptionalIResolvableCodeConfigurationoptionalinterface{}#
Configuration for building and running the service from a source code repository.

CodeConfiguration is required only for CreateService request.

repositoryUrlstringrepository_urlstrrepositoryUrlStringRepositoryUrlstringRepositoryUrl*stringrequired#
The location of the repository that contains the source code.
sourceCodeVersionIResolvable | CfnService.SourceCodeVersionPropertysource_code_versiontyping.Union[IResolvable, SourceCodeVersionProperty]sourceCodeVersionIResolvableSourceCodeVersionIResolvableSourceCodeVersioninterface{}required#
The version that should be used within the source code repository.
sourceDirectoryoptionalstringsource_directoryoptionalstrsourceDirectoryoptionalStringSourceDirectoryoptionalstringSourceDirectoryoptional*string#
The path of the directory that stores source code and configuration files.

The build and start commands also execute from here. The path is absolute from root and, if not specified, defaults to the repository root.