# SourcedConfiguration

A sourced configuration represents configuration stored in an Amazon S3 bucket, AWS Secrets Manager secret, Systems Manager (SSM) Parameter Store parameter, SSM document, or AWS CodePipeline.

Extends: Construct › SourcedConfiguration
Implements: IConfiguration, IExtensible, IConstruct, IDependable

- Source: [`aws-appconfig/lib/configuration.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts#L576)
- Type last changed: v2.199.0 · 27 May 2025

## Example

```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.',
});
```

## Initializer

```ts
new SourcedConfiguration(scope: Construct, id: string, props: SourcedConfigurationProps)
```

## Construct Props

- `application`: [IApplication](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.IApplication.html) (required) — The application associated with the configuration.

- `deletionProtectionCheck`: [DeletionProtectionCheck](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.DeletionProtectionCheck.html) — A parameter to configure deletion protection.

  **Default:** DeletionProtectionCheck.ACCOUNT_DEFAULT

  Deletion protection prevents a user from deleting a configuration profile if your application has called
  either `GetLatestConfiguration` or `GetConfiguration` for the configuration profile during the specified interval.

- `deploymentKey`: [IKey](/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) = None. — The deployment key of the configuration.

- `deploymentStrategy`: [IDeploymentStrategyRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_appconfig.IDeploymentStrategyRef.html) — The deployment strategy for the configuration.

  **Default:** A deployment strategy with the rollout strategy set to RolloutStrategy.CANARY_10_PERCENT_20_MINUTES

- `deployTo`: [IEnvironment](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.IEnvironment.html)[] = None. — The list of environments to deploy the configuration to.

  If this parameter is not specified, then there will be no
  deployment created alongside this configuration.

  Deployments can be added later using the `IEnvironment.addDeployment` or
  `IEnvironment.addDeployments` methods.

- `description`: string — The description of the configuration.

  **Default:** No description.

- `location`: [ConfigurationSource](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.ConfigurationSource.html) (required) — The location where the configuration is stored.

- `name`: string — The name of the configuration.

  **Default:** A name is generated.

- `retrievalRole`: [IRoleRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_iam.IRoleRef.html) — The IAM role to retrieve the configuration.

  **Default:** Auto generated if location type is not ConfigurationSourceType.CODE_PIPELINE otherwise no role specified.

- `type`: [ConfigurationType](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.ConfigurationType.html) = ConfigurationType.FREEFORM — The type of configuration.

- `validators`: [IValidator](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.IValidator.html)[] — The validators for the configuration.

  **Default:** No validators.

- `versionNumber`: string = None. — The version number of the sourced configuration to deploy.

  If this is not specified,
  then there will be no deployment.

## Properties

- `application`: [IApplication](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.IApplication.html) — The application associated with the configuration.

- `configurationProfileArn`: string — The Amazon Resource Name (ARN) of the configuration profile.

- `configurationProfileId`: string — The ID of the configuration profile.

- `deploymentKey`: [IKey](/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — The deployment key for the configuration.

- `deploymentStrategy`: [IDeploymentStrategy](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.IDeploymentStrategy.html) — The deployment strategy for the configuration.

- `deployTo`: [IEnvironment](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.IEnvironment.html)[] — The environments to deploy to.

- `description`: string — The description of the configuration.

- `location`: [ConfigurationSource](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.ConfigurationSource.html) — The location where the configuration is stored.

- `name`: string — The name of the configuration.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `retrievalRole`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The IAM role to retrieve the configuration.

- `sourceKey`: [IKey](/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — The key to decrypt the configuration if applicable.

  This key
  can be used when storing configuration in AWS Secrets Manager, Systems Manager Parameter Store,
  or Amazon S3.

- `type`: [ConfigurationType](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.ConfigurationType.html) — The configuration type.

- `validators`: [IValidator](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.IValidator.html)[] — The validators for the configuration.

- `versionNumber`: string — The version number of the configuration to deploy.

## Methods

- `addExtension(extension: IExtension): void` — Adds an extension association to the configuration profile.

  **Parameters**

  - `extension` — The extension to create an association for.

- `atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): void` — Adds an AT_DEPLOYMENT_TICK extension with the provided event destination and also creates an extension association to an application.

  **Parameters**

  - `eventDestination` — The event that occurs during the extension.
  - `options` — Options for the extension.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `on(actionPoint: ActionPoint, eventDestination: IEventDestination, options?: ExtensionOptions): void` — Adds an extension defined by the action point and event destination and also creates an extension association to the configuration profile.

  **Parameters**

  - `actionPoint` — The action point which triggers the event.
  - `eventDestination` — The event that occurs during the extension.
  - `options` — Options for the extension.

- `onDeploymentBaking(eventDestination: IEventDestination, options?: ExtensionOptions): void` — Adds an ON_DEPLOYMENT_BAKING extension with the provided event destination and also creates an extension association to the configuration profile.

  **Parameters**

  - `eventDestination` — The event that occurs during the extension.
  - `options` — Options for the extension.

- `onDeploymentComplete(eventDestination: IEventDestination, options?: ExtensionOptions): void` — Adds an ON_DEPLOYMENT_COMPLETE extension with the provided event destination and also creates an extension association to the configuration profile.

  **Parameters**

  - `eventDestination` — The event that occurs during the extension.
  - `options` — Options for the extension.

- `onDeploymentRolledBack(eventDestination: IEventDestination, options?: ExtensionOptions): void` — Adds an ON_DEPLOYMENT_ROLLED_BACK extension with the provided event destination and also creates an extension association to the configuration profile.

  **Parameters**

  - `eventDestination` — The event that occurs during the extension.
  - `options` — Options for the extension.

- `onDeploymentStart(eventDestination: IEventDestination, options?: ExtensionOptions): void` — Adds an ON_DEPLOYMENT_START extension with the provided event destination and also creates an extension association to the configuration profile.

  **Parameters**

  - `eventDestination` — The event that occurs during the extension.
  - `options` — Options for the extension.

- `onDeploymentStep(eventDestination: IEventDestination, options?: ExtensionOptions): void` — Adds an ON_DEPLOYMENT_STEP extension with the provided event destination and also creates an extension association to the configuration profile.

  **Parameters**

  - `eventDestination` — The event that occurs during the extension.
  - `options` — Options for the extension.

- `preCreateHostedConfigurationVersion(eventDestination: IEventDestination, options?: ExtensionOptions): void` — Adds a PRE_CREATE_HOSTED_CONFIGURATION_VERSION extension with the provided event destination and also creates an extension association to the configuration profile.

  **Parameters**

  - `eventDestination` — The event that occurs during the extension.
  - `options` — Options for the extension.

- `preStartDeployment(eventDestination: IEventDestination, options?: ExtensionOptions): void` — Adds a PRE_START_DEPLOYMENT extension with the provided event destination and also creates an extension association to the configuration profile.

  **Parameters**

  - `eventDestination` — The event that occurs during the extension.
  - `options` — Options for the extension.

- `toString(): string` — Returns a string representation of this construct.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
