# CodeConfigurationProperty

Describes the configuration that AWS App Runner uses to build and run an App Runner service from a source code repository.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```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 codeConfigurationProperty: apprunner.CfnService.CodeConfigurationProperty = {
  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',
  },
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_apprunner as apprunner

code_configuration_property = apprunner.CfnService.CodeConfigurationProperty(
    configuration_source="configurationSource",

    # the properties below are optional
    code_configuration_values=apprunner.CfnService.CodeConfigurationValuesProperty(
        runtime="runtime",

        # the properties below are optional
        build_command="buildCommand",
        port="port",
        runtime_environment_secrets=[apprunner.CfnService.KeyValuePairProperty(
            name="name",
            value="value"
        )],
        runtime_environment_variables=[apprunner.CfnService.KeyValuePairProperty(
            name="name",
            value="value"
        )],
        start_command="startCommand"
    )
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.apprunner.*;

CodeConfigurationProperty codeConfigurationProperty = CodeConfigurationProperty.builder()
        .configurationSource("configurationSource")

        // the properties below are optional
        .codeConfigurationValues(CodeConfigurationValuesProperty.builder()
                .runtime("runtime")

                // the properties below are optional
                .buildCommand("buildCommand")
                .port("port")
                .runtimeEnvironmentSecrets(List.of(KeyValuePairProperty.builder()
                        .name("name")
                        .value("value")
                        .build()))
                .runtimeEnvironmentVariables(List.of(KeyValuePairProperty.builder()
                        .name("name")
                        .value("value")
                        .build()))
                .startCommand("startCommand")
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AppRunner;

var codeConfigurationProperty = new CodeConfigurationProperty {
    ConfigurationSource = "configurationSource",

    // the properties below are optional
    CodeConfigurationValues = new CodeConfigurationValuesProperty {
        Runtime = "runtime",

        // the properties below are optional
        BuildCommand = "buildCommand",
        Port = "port",
        RuntimeEnvironmentSecrets = new [] { new KeyValuePairProperty {
            Name = "name",
            Value = "value"
        } },
        RuntimeEnvironmentVariables = new [] { new KeyValuePairProperty {
            Name = "name",
            Value = "value"
        } },
        StartCommand = "startCommand"
    }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

codeConfigurationProperty := &CodeConfigurationProperty{
	ConfigurationSource: jsii.String("configurationSource"),

	// the properties below are optional
	CodeConfigurationValues: &CodeConfigurationValuesProperty{
		Runtime: jsii.String("runtime"),

		// the properties below are optional
		BuildCommand: jsii.String("buildCommand"),
		Port: jsii.String("port"),
		RuntimeEnvironmentSecrets: []interface{}{
			&KeyValuePairProperty{
				Name: jsii.String("name"),
				Value: jsii.String("value"),
			},
		},
		RuntimeEnvironmentVariables: []interface{}{
			&KeyValuePairProperty{
				Name: jsii.String("name"),
				Value: jsii.String("value"),
			},
		},
		StartCommand: jsii.String("startCommand"),
	},
}
```

## Properties

- `codeConfigurationValues`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.CodeConfigurationValuesProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apprunner.CfnService.CodeConfigurationValuesProperty.html) — The basic configuration for building and running the App Runner service.

  Use it to quickly launch an App Runner service without providing a `apprunner.yaml` file in the source code repository (or ignoring the file if it exists).

- `configurationSource`: string (required) — The source of the App Runner configuration. Values are interpreted as follows:.

  - `REPOSITORY` – App Runner reads configuration values from the `apprunner.yaml` file in the source code repository and ignores `CodeConfigurationValues` .
  - `API` – App Runner uses configuration values provided in `CodeConfigurationValues` and ignores the `apprunner.yaml` file in the source code repository.
