# ConfigurationSource

Defines the integrated configuration sources.

Obtainable from: ConfigurationSource.fromBucket, ConfigurationSource.fromCfnDocument, ConfigurationSource.fromParameter, ConfigurationSource.fromPipeline, ConfigurationSource.fromSecret

- Source: [`aws-appconfig/lib/configuration.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts#L974)
- Type last changed: v2.234.0 · 8 Jan 2026

## Example

TypeScript:

```ts
declare const application: appconfig.Application;
declare const bucket: s3.Bucket;

new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
  application,
  location: appconfig.ConfigurationSource.fromBucket(bucket, 'path/to/file.json'),
  type: appconfig.ConfigurationType.FEATURE_FLAGS,
  name: 'MyConfig',
  description: 'This is my sourced configuration from CDK.',
});
```

Python:

```python
# application: appconfig.Application
# bucket: s3.Bucket

appconfig.SourcedConfiguration(self, "MySourcedConfiguration",
    application=application,
    location=appconfig.ConfigurationSource.from_bucket(bucket, "path/to/file.json"),
    type=appconfig.ConfigurationType.FEATURE_FLAGS,
    name="MyConfig",
    description="This is my sourced configuration from CDK."
)
```

Java:

```java
Application application;
Bucket bucket;

SourcedConfiguration.Builder.create(this, "MySourcedConfiguration")
        .application(application)
        .location(ConfigurationSource.fromBucket(bucket, "path/to/file.json"))
        .type(ConfigurationType.FEATURE_FLAGS)
        .name("MyConfig")
        .description("This is my sourced configuration from CDK.")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Application application;
Bucket bucket;

new SourcedConfiguration(this, "MySourcedConfiguration", new SourcedConfigurationProps {
    Application = application,
    Location = ConfigurationSource.FromBucket(bucket, "path/to/file.json"),
    Type = ConfigurationType.FEATURE_FLAGS,
    Name = "MyConfig",
    Description = "This is my sourced configuration from CDK."
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var application Application
var bucket Bucket

appconfig.NewSourcedConfiguration(this, jsii.String("MySourcedConfiguration"), &SourcedConfigurationProps{
	Application: Application,
	Location: appconfig.ConfigurationSource_FromBucket(bucket, jsii.String("path/to/file.json")),
	Type: appconfig.ConfigurationType_FEATURE_FLAGS,
	Name: jsii.String("MyConfig"),
	Description: jsii.String("This is my sourced configuration from CDK."),
})
```

## Initializer

TypeScript:

```ts
new ConfigurationSource()
```

Python:

```python
ConfigurationSource()
```

Java:

```java
new ConfigurationSource()
```

C# / .NET:

```csharp
new ConfigurationSource()
```

Golang:

```go
NewConfigurationSource()
```

## Properties

- `key`: [IKey](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — The KMS Key that encrypts the configuration.

- `locationUri`: string — The URI of the configuration source.

- `type`: [ConfigurationSourceType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.ConfigurationSourceType.html) — The type of the configuration source.

## Methods

- `fromBucket(bucket: IBucket, objectKey: string, key?: IKey): ConfigurationSource // chainable` (static) — Defines configuration content from an Amazon S3 bucket.

  **Parameters**

  - `bucket` — The S3 bucket where the configuration is stored.
  - `objectKey` — The path to the configuration.
  - `key` — The KMS Key that the bucket is encrypted with.

- `fromCfnDocument(document: CfnDocument): ConfigurationSource // chainable` (static) — Defines configuration content from a Systems Manager (SSM) document.

  **Parameters**

  - `document` — The SSM document where the configuration is stored.

- `fromParameter(parameter: IParameter, key?: IKey): ConfigurationSource // chainable` (static) — Defines configuration content from a Systems Manager (SSM) Parameter Store parameter.

  **Parameters**

  - `parameter` — The parameter where the configuration is stored.
  - `key` — The KMS Key that the secure string is encrypted with.

- `fromPipeline(pipeline: IPipelineRef): ConfigurationSource // chainable` (static) — Defines configuration content from AWS CodePipeline.

  **Parameters**

  - `pipeline` — The pipeline where the configuration is stored.

- `fromSecret(secret: ISecret): ConfigurationSource // chainable` (static) — Defines configuration content from an AWS Secrets Manager secret.

  **Parameters**

  - `secret` — The secret where the configuration is stored.
