agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
{
"targets": {
"java": {
"package": "software.amazon.awscdk.services.appconfig"
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.AppConfig"
},
"python": {
"module": "aws_cdk.aws_appconfig"
}
}
}

703
cdk/node_modules/aws-cdk-lib/aws-appconfig/README.md generated vendored Normal file
View File

@@ -0,0 +1,703 @@
# AWS AppConfig Construct Library
This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
For a high level overview of what AWS AppConfig is and how it works, please take a look here:
[What is AWS AppConfig?](https://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html)
## Basic Hosted Configuration Use Case
> The main way most AWS AppConfig users utilize the service is through hosted configuration, which involves storing
> configuration data directly within AWS AppConfig.
An example use case:
```ts
const app = new appconfig.Application(this, 'MyApp');
const env = new appconfig.Environment(this, 'MyEnv', {
application: app,
});
new appconfig.HostedConfiguration(this, 'MyHostedConfig', {
application: app,
deployTo: [env],
content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'),
});
```
This will create the application and environment for your configuration and then deploy your configuration to the
specified environment.
For more information about what these resources are: [Creating feature flags and free form configuration data in AWS AppConfig](https://docs.aws.amazon.com/appconfig/latest/userguide/creating-feature-flags-and-configuration-data.html).
For more information about deploying configuration: [Deploying feature flags and configuration data in AWS AppConfig](https://docs.aws.amazon.com/appconfig/latest/userguide/deploying-feature-flags.html)
____
For an in-depth walkthrough of specific resources and how to use them, please take a look at the following sections.
## Application
[AWS AppConfig Application Documentation](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-namespace.html)
In AWS AppConfig, an application is simply an organizational
construct like a folder. Configurations and environments are
associated with the application.
When creating an application through CDK, the name and
description of an application are optional.
Create a simple application:
```ts
new appconfig.Application(this, 'MyApplication');
```
## Environment
[AWS AppConfig Environment Documentation](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-environment.html)
Basic environment with monitors:
```ts
declare const application: appconfig.Application;
declare const alarm: cloudwatch.Alarm;
declare const compositeAlarm: cloudwatch.CompositeAlarm;
new appconfig.Environment(this, 'MyEnvironment', {
application,
monitors: [
appconfig.Monitor.fromCloudWatchAlarm(alarm),
appconfig.Monitor.fromCloudWatchAlarm(compositeAlarm),
],
});
```
Environment monitors also support L1 `CfnEnvironment.MonitorsProperty` constructs through the `fromCfnMonitorsProperty` method.
However, this is not the recommended approach for CloudWatch alarms because a role will not be auto-generated if not provided.
See [About the AWS AppConfig data plane service](https://docs.aws.amazon.com/appconfig/latest/userguide/about-data-plane.html) for more information.
### Permissions
You can grant read permission on the environment's configurations with the grantReadConfig method as follows:
```ts
import * as iam from 'aws-cdk-lib/aws-iam';
const app = new appconfig.Application(this, 'MyAppConfig');
const env = new appconfig.Environment(this, 'MyEnvironment', {
application: app,
});
const user = new iam.User(this, 'MyUser');
env.grantReadConfig(user);
```
## Deployment Strategy
[AWS AppConfig Deployment Strategy Documentation](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-deployment-strategy.html)
A deployment strategy defines how a configuration will roll out. The roll out is defined by four parameters: deployment type,
growth factor, deployment duration, and final bake time.
Deployment strategy with predefined values:
```ts
new appconfig.DeploymentStrategy(this, 'MyDeploymentStrategy', {
rolloutStrategy: appconfig.RolloutStrategy.CANARY_10_PERCENT_20_MINUTES,
});
```
Deployment strategy with custom values:
```ts
new appconfig.DeploymentStrategy(this, 'MyDeploymentStrategy', {
rolloutStrategy: appconfig.RolloutStrategy.linear({
growthFactor: 20,
deploymentDuration: Duration.minutes(30),
finalBakeTime: Duration.minutes(30),
}),
});
```
Referencing a deployment strategy by ID:
```ts
appconfig.DeploymentStrategy.fromDeploymentStrategyId(this, 'MyImportedDeploymentStrategy', appconfig.DeploymentStrategyId.fromString('abc123'));
```
Referencing an AWS AppConfig predefined deployment strategy by ID:
```ts
appconfig.DeploymentStrategy.fromDeploymentStrategyId(
this,
'MyImportedPredefinedDeploymentStrategy',
appconfig.DeploymentStrategyId.CANARY_10_PERCENT_20_MINUTES,
);
```
## Configuration
A configuration is a higher-level construct that can either be a `HostedConfiguration` (stored internally through AWS
AppConfig) or a `SourcedConfiguration` (stored in an Amazon S3 bucket, AWS Secrets Manager secrets, Systems Manager (SSM)
Parameter Store parameters, SSM documents, or AWS CodePipeline). This construct manages deployments on creation.
### HostedConfiguration
A hosted configuration represents configuration stored in the AWS AppConfig hosted configuration store. A hosted configuration
takes in the configuration content and associated AWS AppConfig application. On construction of a hosted configuration, the
configuration is deployed.
You can define hosted configuration content using any of the following ConfigurationContent methods:
* `fromFile` - Defines the hosted configuration content from a file (you can specify a relative path). The content type will
be determined by the file extension unless specified.
```ts
declare const application: appconfig.Application;
new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
application,
content: appconfig.ConfigurationContent.fromFile('config.json'),
});
```
* `fromInlineText` - Defines the hosted configuration from inline text. The content type will be set as `text/plain`.
```ts
declare const application: appconfig.Application;
new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
application,
content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'),
});
```
* `fromInlineJson` - Defines the hosted configuration from inline JSON. The content type will be set as `application/json` unless specified.
```ts
declare const application: appconfig.Application;
new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
application,
content: appconfig.ConfigurationContent.fromInlineJson('{}'),
});
```
* `fromInlineYaml` - Defines the hosted configuration from inline YAML. The content type will be set as `application/x-yaml`.
```ts
declare const application: appconfig.Application;
new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
application,
content: appconfig.ConfigurationContent.fromInlineYaml('MyConfig: This is my content.'),
});
```
* `fromInline` - Defines the hosted configuration from user-specified content types. The content type will be set as `application/octet-stream` unless specified.
```ts
declare const application: appconfig.Application;
new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
application,
content: appconfig.ConfigurationContent.fromInline('This is my configuration content.'),
});
```
AWS AppConfig supports the following types of configuration profiles.
* **[Feature flag](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-configuration-and-profile-feature-flags.html)**: Use a feature flag configuration to turn on new features that require a timely deployment, such as a product launch or announcement.
* **[Freeform](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-free-form-configurations-creating.html)**: Use a freeform configuration to carefully introduce changes to your application.
A hosted configuration with type:
```ts
declare const application: appconfig.Application;
new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
application,
content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'),
type: appconfig.ConfigurationType.FEATURE_FLAGS,
});
```
When you create a configuration and configuration profile, you can specify up to two validators. A validator ensures that your
configuration data is syntactically and semantically correct. You can create validators in either JSON Schema or as an AWS
Lambda function.
See [About validators](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-configuration-and-profile.html#appconfig-creating-configuration-and-profile-validators) for more information.
When you import a JSON Schema validator from a file, you can pass in a relative path.
A hosted configuration with validators:
```ts
declare const application: appconfig.Application;
declare const fn: lambda.Function;
new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
application,
content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'),
validators: [
appconfig.JsonSchemaValidator.fromFile('schema.json'),
appconfig.LambdaValidator.fromFunction(fn),
],
});
```
You can attach a deployment strategy (as described in the previous section) to your configuration to specify how you want your
configuration to roll out.
A hosted configuration with a deployment strategy:
```ts
declare const application: appconfig.Application;
new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
application,
content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'),
deploymentStrategy: new appconfig.DeploymentStrategy(this, 'MyDeploymentStrategy', {
rolloutStrategy: appconfig.RolloutStrategy.linear({
growthFactor: 15,
deploymentDuration: Duration.minutes(30),
finalBakeTime: Duration.minutes(15),
}),
}),
});
```
The `deployTo` parameter is used to specify which environments to deploy the configuration to.
A hosted configuration with `deployTo`:
```ts
declare const application: appconfig.Application;
declare const env: appconfig.Environment;
new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
application,
content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'),
deployTo: [env],
});
```
When more than one configuration is set to deploy to the same environment, the
deployments will occur one at a time. This is done to satisfy
[AppConfig's constraint](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-deploying.html):
> [!NOTE]
> You can only deploy one configuration at a time to an environment.
> However, you can deploy one configuration each to different environments at the same time.
The deployment order matches the order in which the configurations are declared.
```ts
const app = new appconfig.Application(this, 'MyApp');
const env = new appconfig.Environment(this, 'MyEnv', {
application: app,
});
new appconfig.HostedConfiguration(this, 'MyFirstHostedConfig', {
application: app,
deployTo: [env],
content: appconfig.ConfigurationContent.fromInlineText('This is my first configuration content.'),
});
new appconfig.HostedConfiguration(this, 'MySecondHostedConfig', {
application: app,
deployTo: [env],
content: appconfig.ConfigurationContent.fromInlineText('This is my second configuration content.'),
});
```
If an application would benefit from a deployment order that differs from the
declared order, you can defer the decision by using `IEnvironment.addDeployment`
rather than the `deployTo` property.
In this example, `firstConfig` will be deployed before `secondConfig`.
```ts
const app = new appconfig.Application(this, 'MyApp');
const env = new appconfig.Environment(this, 'MyEnv', {
application: app,
});
const secondConfig = new appconfig.HostedConfiguration(this, 'MySecondHostedConfig', {
application: app,
content: appconfig.ConfigurationContent.fromInlineText('This is my second configuration content.'),
});
const firstConfig = new appconfig.HostedConfiguration(this, 'MyFirstHostedConfig', {
application: app,
deployTo: [env],
content: appconfig.ConfigurationContent.fromInlineText('This is my first configuration content.'),
});
env.addDeployment(secondConfig);
```
Alternatively, you can defer multiple deployments in favor of
`IEnvironment.addDeployments`, which allows you to declare multiple
configurations in the order they will be deployed.
In this example the deployment order will be
`firstConfig`, then `secondConfig`, and finally `thirdConfig`.
```ts
const app = new appconfig.Application(this, 'MyApp');
const env = new appconfig.Environment(this, 'MyEnv', {
application: app,
});
const secondConfig = new appconfig.HostedConfiguration(this, 'MySecondHostedConfig', {
application: app,
content: appconfig.ConfigurationContent.fromInlineText('This is my second configuration content.'),
});
const thirdConfig = new appconfig.HostedConfiguration(this, 'MyThirdHostedConfig', {
application: app,
content: appconfig.ConfigurationContent.fromInlineText('This is my third configuration content.'),
});
const firstConfig = new appconfig.HostedConfiguration(this, 'MyFirstHostedConfig', {
application: app,
content: appconfig.ConfigurationContent.fromInlineText('This is my first configuration content.'),
});
env.addDeployments(firstConfig, secondConfig, thirdConfig);
```
Any mix of `deployTo`, `addDeployment`, and `addDeployments` is permitted.
The declaration order will be respected regardless of the approach used.
> [!IMPORTANT]
> If none of these options are utilized, there will not be any deployments.
You can use customer managed key to encrypt a hosted configuration. For mora information, see [Data encryption at rest for AWS AppConfig](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-security.html#appconfig-security-data-encryption).
```ts
declare const application: appconfig.Application;
declare const kmsKey: kms.Key;
new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
application,
content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'),
type: appconfig.ConfigurationType.FEATURE_FLAGS,
kmsKey, // set customer managed key
});
```
### SourcedConfiguration
A sourced configuration represents configuration stored in any of the following:
* Amazon S3 bucket
* AWS Secrets Manager secret
* Systems Manager
* (SSM) Parameter Store parameter
* SSM document
* AWS CodePipeline.
A sourced configuration takes in the location source
construct and optionally a version number to deploy. On construction of a sourced configuration, the configuration is deployed
only if a version number is specified.
### S3
Use an Amazon S3 bucket to store a configuration.
```ts
declare const application: appconfig.Application;
const bucket = new s3.Bucket(this, 'MyBucket', {
versioned: true,
});
new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
application,
location: appconfig.ConfigurationSource.fromBucket(bucket, 'path/to/file.json'),
});
```
Use an encrypted bucket:
```ts
declare const application: appconfig.Application;
const bucket = new s3.Bucket(this, 'MyBucket', {
versioned: true,
encryption: s3.BucketEncryption.KMS,
});
new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
application,
location: appconfig.ConfigurationSource.fromBucket(bucket, 'path/to/file.json'),
});
```
### AWS Secrets Manager secret
Use a Secrets Manager secret to store a configuration.
```ts
declare const application: appconfig.Application;
declare const secret: secrets.Secret;
new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
application,
location: appconfig.ConfigurationSource.fromSecret(secret),
});
```
### SSM Parameter Store parameter
Use an SSM parameter to store a configuration.
```ts
declare const application: appconfig.Application;
declare const parameter: ssm.StringParameter;
new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
application,
location: appconfig.ConfigurationSource.fromParameter(parameter),
versionNumber: '1',
});
```
### SSM document
Use an SSM document to store a configuration.
```ts
declare const application: appconfig.Application;
declare const document: ssm.CfnDocument;
new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
application,
location: appconfig.ConfigurationSource.fromCfnDocument(document),
});
```
### AWS CodePipeline
Use an AWS CodePipeline pipeline to store a configuration.
```ts
declare const application: appconfig.Application;
declare const pipeline: codepipeline.Pipeline;
new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
application,
location: appconfig.ConfigurationSource.fromPipeline(pipeline),
});
```
Similar to a hosted configuration, a sourced configuration can optionally take in a type, validators, a `deployTo` parameter, and a deployment strategy.
A sourced configuration with type:
```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.',
});
```
A sourced configuration with validators:
```ts
declare const application: appconfig.Application;
declare const bucket: s3.Bucket;
declare const fn: lambda.Function;
new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
application,
location: appconfig.ConfigurationSource.fromBucket(bucket, 'path/to/file.json'),
validators: [
appconfig.JsonSchemaValidator.fromFile('schema.json'),
appconfig.LambdaValidator.fromFunction(fn),
],
});
```
A sourced configuration with a deployment strategy:
```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'),
deploymentStrategy: new appconfig.DeploymentStrategy(this, 'MyDeploymentStrategy', {
rolloutStrategy: appconfig.RolloutStrategy.linear({
growthFactor: 15,
deploymentDuration: Duration.minutes(30),
finalBakeTime: Duration.minutes(15),
}),
}),
});
```
## Deletion Protection Check
You can enable [deletion protection](https://docs.aws.amazon.com/appconfig/latest/userguide/deletion-protection.html) on the environment and configuration profile by setting the `deletionProtectionCheck` property.
- ACCOUNT_DEFAULT: The default setting, which uses account-level deletion protection. To configure account-level deletion protection, use the UpdateAccountSettings API.
- APPLY: Instructs the deletion protection check to run, even if deletion protection is disabled at the account level. APPLY also forces the deletion protection check to run against resources created in the past hour, which are normally excluded from deletion protection checks.
- BYPASS: Instructs AWS AppConfig to bypass the deletion protection check and delete an environment even if deletion protection would have otherwise prevented it.
```ts
declare const application: appconfig.Application;
declare const alarm: cloudwatch.Alarm;
declare const compositeAlarm: cloudwatch.CompositeAlarm;
declare const bucket: s3.Bucket;
// Environment deletion protection check
new appconfig.Environment(this, 'MyEnvironment', {
application,
deletionProtectionCheck: appconfig.DeletionProtectionCheck.APPLY,
});
// configuration profile with deletion protection check
new appconfig.HostedConfiguration(this, 'MyHostedConfigFromFile', {
application,
content: appconfig.ConfigurationContent.fromFile('config.json'),
deletionProtectionCheck: appconfig.DeletionProtectionCheck.BYPASS,
});
new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
application,
location: appconfig.ConfigurationSource.fromBucket(bucket, 'path/to/file.json'),
deletionProtectionCheck: appconfig.DeletionProtectionCheck.ACCOUNT_DEFAULT,
});
```
## Extension
An extension augments your ability to inject logic or behavior at different points during the AWS AppConfig workflow of
creating or deploying a configuration. You can associate these types of tasks with AWS AppConfig applications, environments, and configuration profiles.
See: https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html
An extension defines one or more actions, that it performs during an AWS AppConfig workflow. Each action is invoked either when you interact with AWS AppConfig or when AWS AppConfig is performing a process on your behalf. These invocation points are called action points. AWS AppConfig extensions support the following action points:
* PRE_START_DEPLOYMENT
* PRE_CREATE_HOSTED_CONFIGURATION_VERSION
* ON_DEPLOYMENT_START
* ON_DEPLOYMENT_STEP
* ON_DEPLOYMENT_BAKING
* ON_DEPLOYMENT_COMPLETE
* ON_DEPLOYMENT_ROLLED_BACK
* AT_DEPLOYMENT_TICK
See: https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions-about.html
### AWS Lambda destination
Use an AWS Lambda as the event destination for an extension.
```ts
declare const fn: lambda.Function;
new appconfig.Extension(this, 'MyExtension', {
actions: [
new appconfig.Action({
actionPoints: [appconfig.ActionPoint.ON_DEPLOYMENT_START],
eventDestination: new appconfig.LambdaDestination(fn),
}),
],
});
```
Lambda extension with parameters:
```ts
declare const fn: lambda.Function;
new appconfig.Extension(this, 'MyExtension', {
actions: [
new appconfig.Action({
actionPoints: [appconfig.ActionPoint.ON_DEPLOYMENT_START],
eventDestination: new appconfig.LambdaDestination(fn),
}),
],
parameters: [
appconfig.Parameter.required('testParam', 'true'),
appconfig.Parameter.notRequired('testNotRequiredParam'),
]
});
```
### Amazon Simple Queue Service (SQS) destination
Use a queue as the event destination for an extension.
```ts
declare const queue: sqs.Queue;
new appconfig.Extension(this, 'MyExtension', {
actions: [
new appconfig.Action({
actionPoints: [appconfig.ActionPoint.ON_DEPLOYMENT_START],
eventDestination: new appconfig.SqsDestination(queue),
}),
],
});
```
### Amazon Simple Notification Service (SNS) destination
Use an SNS topic as the event destination for an extension.
```ts
declare const topic: sns.Topic;
new appconfig.Extension(this, 'MyExtension', {
actions: [
new appconfig.Action({
actionPoints: [appconfig.ActionPoint.ON_DEPLOYMENT_START],
eventDestination: new appconfig.SnsDestination(topic),
}),
],
});
```
### Amazon EventBridge destination
Use the default event bus as the event destination for an extension.
```ts
const bus = events.EventBus.fromEventBusName(this, 'MyEventBus', 'default');
new appconfig.Extension(this, 'MyExtension', {
actions: [
new appconfig.Action({
actionPoints: [appconfig.ActionPoint.ON_DEPLOYMENT_START],
eventDestination: new appconfig.EventBridgeDestination(bus),
}),
],
});
```
You can also add extensions and their associations directly by calling `onDeploymentComplete()` or any other action point
method on the AWS AppConfig application, configuration, or environment resource. To add an association to an existing
extension, you can call `addExtension()` on the resource.
Adding an association to an AWS AppConfig application:
```ts
declare const application: appconfig.Application;
declare const extension: appconfig.Extension;
declare const lambdaDestination: appconfig.LambdaDestination;
application.addExtension(extension);
application.onDeploymentComplete(lambdaDestination);
```

16
cdk/node_modules/aws-cdk-lib/aws-appconfig/grants.json generated vendored Normal file
View File

@@ -0,0 +1,16 @@
{
"resources": {
"Environment": {
"grants": {
"readConfig": {
"arnFormat": "${environmentArn}/configuration/*",
"actions": [
"appconfig:GetLatestConfiguration",
"appconfig:StartConfigurationSession"
]
}
}
}
}
}

View File

@@ -0,0 +1 @@
export * from './lib';

1
cdk/node_modules/aws-cdk-lib/aws-appconfig/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,318 @@
import type { Construct } from 'constructs';
import type { HostedConfigurationOptions, SourcedConfigurationOptions } from './configuration';
import { HostedConfiguration, SourcedConfiguration } from './configuration';
import type { EnvironmentOptions, IEnvironment } from './environment';
import type { ActionPoint, IEventDestination, ExtensionOptions, IExtension, IExtensible } from './extension';
import { ExtensibleBase } from './extension';
import * as ecs from '../../aws-ecs';
import * as cdk from '../../core';
import type { IApplicationRef, IEnvironmentRef, ApplicationReference } from '../../interfaces/generated/aws-appconfig-interfaces.generated';
/**
* Defines the platform for the AWS AppConfig Lambda extension.
*/
export declare enum Platform {
X86_64 = "x86-64",
ARM_64 = "ARM64"
}
export interface IApplication extends cdk.IResource, IApplicationRef {
/**
* The description of the application.
*/
readonly description?: string;
/**
* The name of the application.
*/
readonly name?: string;
/**
* The ID of the application.
* @attribute
*/
readonly applicationId: string;
/**
* The Amazon Resource Name (ARN) of the application.
* @attribute
*/
readonly applicationArn: string;
/**
* Adds an environment.
*
* @param id The name of the environment construct
* @param options The options for the environment construct
*/
addEnvironment(id: string, options?: EnvironmentOptions): IEnvironment;
/**
* Adds a hosted configuration.
*
* @param id The name of the hosted configuration construct
* @param options The options for the hosted configuration construct
*/
addHostedConfiguration(id: string, options: HostedConfigurationOptions): HostedConfiguration;
/**
* Adds a sourced configuration.
*
* @param id The name of the sourced configuration construct
* @param options The options for the sourced configuration construct
*/
addSourcedConfiguration(id: string, options: SourcedConfigurationOptions): SourcedConfiguration;
/**
* Adds an existing environment.
*
* @param environment The environment
*/
addExistingEnvironment(environment: IEnvironmentRef): void;
/**
* Returns the list of associated environments.
*/
environments(): IEnvironment[];
/**
* Adds an extension defined by the action point and event destination
* and also creates an extension association to an application.
*
* @param actionPoint The action point which triggers the event
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
on(actionPoint: ActionPoint, 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 an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
preCreateHostedConfigurationVersion(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds a PRE_START_DEPLOYMENT extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
preStartDeployment(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_START extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentStart(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_STEP extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentStep(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_BAKING extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentBaking(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_COMPLETE extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentComplete(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_ROLLED_BACK extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentRolledBack(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.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an extension association to the application.
*
* @param extension The extension to create an association for
*/
addExtension(extension: IExtension): void;
}
/**
* Properties for the Application construct
*/
export interface ApplicationProps {
/**
* The name of the application.
*
* @default - A name is generated.
*/
readonly applicationName?: string;
/**
* The description for the application.
*
* @default - No description.
*/
readonly description?: string;
}
declare abstract class ApplicationBase extends cdk.Resource implements IApplication, IExtensible {
abstract applicationId: string;
abstract applicationArn: string;
private _environments;
protected abstract extensible: ExtensibleBase;
get applicationRef(): ApplicationReference;
addEnvironment(id: string, options?: EnvironmentOptions): IEnvironment;
addHostedConfiguration(id: string, options: HostedConfigurationOptions): HostedConfiguration;
addSourcedConfiguration(id: string, options: SourcedConfigurationOptions): SourcedConfiguration;
addExistingEnvironment(environment: IEnvironmentRef): void;
environments(): IEnvironment[];
/**
* Adds an extension defined by the action point and event destination
* and also creates an extension association to an application.
*
* @param actionPoint The action point which triggers the event
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
on(actionPoint: ActionPoint, 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 an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
preCreateHostedConfigurationVersion(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds a PRE_START_DEPLOYMENT extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
preStartDeployment(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_START extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentStart(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_STEP extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentStep(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_BAKING extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentBaking(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_COMPLETE extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentComplete(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_ROLLED_BACK extension with the provided event destination and
* also creates an extension association to an application.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentRolledBack(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.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an extension association to the application.
*
* @param extension The extension to create an association for
*/
addExtension(extension: IExtension): void;
}
/**
* An AWS AppConfig application.
*
* @resource AWS::AppConfig::Application
* @see https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-application.html
*/
export declare class Application extends ApplicationBase {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
/**
* Imports an AWS AppConfig application into the CDK using its Amazon Resource Name (ARN).
*
* @param scope The parent construct
* @param id The name of the application construct
* @param applicationArn The Amazon Resource Name (ARN) of the application
*/
static fromApplicationArn(scope: Construct, id: string, applicationArn: string): IApplication;
/**
* Imports an AWS AppConfig application into the CDK using its ID.
*
* @param scope The parent construct
* @param id The name of the application construct
* @param applicationId The ID of the application
*/
static fromApplicationId(scope: Construct, id: string, applicationId: string): IApplication;
/**
* Retrieves the Lambda layer version Amazon Resource Name (ARN) for the AWS AppConfig Lambda extension.
*
* @param region The region for the Lambda layer (for example, 'us-east-1')
* @param platform The platform for the Lambda layer (default is Platform.X86_64)
* @returns Lambda layer version ARN
*/
static getLambdaLayerVersionArn(region: string, platform?: Platform): string;
/**
* Adds the AWS AppConfig Agent as a container to the provided ECS task definition.
*
* @param taskDef The ECS task definition [disable-awslint:ref-via-interface]
*/
static addAgentToEcs(taskDef: ecs.TaskDefinition): void;
/**
* The description of the application.
*/
readonly description?: string;
/**
* The name of the application.
*/
readonly name?: string;
/**
* The ID of the application.
*
* @attribute
*/
readonly applicationId: string;
/**
* The Amazon Resource Name (ARN) of the application.
*
* @attribute
*/
readonly applicationArn: string;
private _application;
protected extensible: ExtensibleBase;
constructor(scope: Construct, id: string, props?: ApplicationProps);
}
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,644 @@
import type { IConstruct } from 'constructs';
import { Construct } from 'constructs';
import type { IApplication } from './application';
import type { IDeploymentStrategy } from './deployment-strategy';
import type { IEnvironment } from './environment';
import type { ActionPoint, IEventDestination, ExtensionOptions, IExtension, IExtensible } from './extension';
import { ExtensibleBase } from './extension';
import type { IDeploymentStrategyRef } from '../../interfaces/generated/aws-appconfig-interfaces.generated';
import type * as cp from '../../aws-codepipeline';
import * as iam from '../../aws-iam';
import type * as kms from '../../aws-kms';
import type * as lambda from '../../aws-lambda';
import type * as s3 from '../../aws-s3';
import type * as sm from '../../aws-secretsmanager';
import type * as ssm from '../../aws-ssm';
import type { DeletionProtectionCheck } from './util';
/**
* Options for the Configuration construct
*/
export interface ConfigurationOptions {
/**
* The deployment strategy for the configuration.
*
* @default - A deployment strategy with the rollout strategy set to
* RolloutStrategy.CANARY_10_PERCENT_20_MINUTES
*/
readonly deploymentStrategy?: IDeploymentStrategyRef;
/**
* The name of the configuration.
*
* @default - A name is generated.
*/
readonly name?: string;
/**
* The validators for the configuration.
*
* @default - No validators.
*/
readonly validators?: IValidator[];
/**
* The description of the configuration.
*
* @default - No description.
*/
readonly description?: string;
/**
* The type of configuration.
*
* @default ConfigurationType.FREEFORM
*/
readonly type?: ConfigurationType;
/**
* 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.
*
* @default - None.
*/
readonly deployTo?: IEnvironment[];
/**
* The deployment key of the configuration.
*
* @default - None.
*/
readonly deploymentKey?: kms.IKey;
/**
* A parameter to configure deletion protection.
* 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.
*
* @see https://docs.aws.amazon.com/appconfig/latest/userguide/deletion-protection.html
*
* @default DeletionProtectionCheck.ACCOUNT_DEFAULT
*/
readonly deletionProtectionCheck?: DeletionProtectionCheck;
}
/**
* Properties for the Configuration construct.
*/
export interface ConfigurationProps extends ConfigurationOptions {
/**
* The application associated with the configuration.
*/
readonly application: IApplication;
}
export interface IConfiguration extends IConstruct {
/**
* The deployment strategy for the configuration.
*/
readonly deploymentStrategy?: IDeploymentStrategy;
/**
* The configuration version number.
*/
readonly versionNumber?: string;
/**
* The application associated with the configuration.
*/
readonly application: IApplication;
/**
* The name of the configuration.
*/
readonly name?: string;
/**
* The validators for the configuration.
*/
readonly validators?: IValidator[];
/**
* The description of the configuration.
*/
readonly description?: string;
/**
* The configuration type.
*/
readonly type?: ConfigurationType;
/**
* The environments to deploy to.
*/
readonly deployTo?: IEnvironment[];
/**
* The deployment key for the configuration.
*/
readonly deploymentKey?: kms.IKey;
/**
* The ID of the configuration profile.
*/
readonly configurationProfileId: string;
}
declare abstract class ConfigurationBase extends Construct implements IConfiguration, IExtensible {
abstract readonly versionNumber?: string;
abstract readonly configurationProfileId: string;
/**
* The application associated with the configuration.
*/
readonly application: IApplication;
/**
* The environments to deploy to.
*/
readonly deployTo?: IEnvironment[];
/**
* The name of the configuration.
*/
readonly name?: string;
/**
* The validators for the configuration.
*/
readonly validators?: IValidator[];
/**
* The description of the configuration.
*/
readonly description?: string;
/**
* The configuration type.
*/
readonly type?: ConfigurationType;
/**
* The deployment key for the configuration.
*/
readonly deploymentKey?: kms.IKey;
private readonly _deploymentStrategy?;
/**
* The deployment strategy for the configuration.
*/
get deploymentStrategy(): IDeploymentStrategy | undefined;
protected applicationId: string;
protected extensible: ExtensibleBase;
protected deletionProtectionCheck?: DeletionProtectionCheck;
constructor(scope: Construct, id: string, props: ConfigurationProps);
/**
* Adds an extension defined by the action point and event destination
* and also creates an extension association to the configuration profile.
*
* @param actionPoint The action point which triggers the event
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
on(actionPoint: ActionPoint, 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.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
preCreateHostedConfigurationVersion(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.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
preStartDeployment(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.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentStart(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.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentStep(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.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentBaking(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.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentComplete(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.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentRolledBack(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.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an extension association to the configuration profile.
*
* @param extension The extension to create an association for
*/
addExtension(extension: IExtension): void;
protected addExistingEnvironmentsToApplication(): void;
protected deployConfigToEnvironments(): void;
}
/**
* Options for HostedConfiguration
*/
export interface HostedConfigurationOptions extends ConfigurationOptions {
/**
* The content of the hosted configuration.
*/
readonly content: ConfigurationContent;
/**
* The latest version number of the hosted configuration.
*
* @default - None.
*/
readonly latestVersionNumber?: number;
/**
* The version label of the hosted configuration.
*
* @default - None.
*/
readonly versionLabel?: string;
}
/**
* Properties for HostedConfiguration
*/
export interface HostedConfigurationProps extends ConfigurationProps {
/**
* The content of the hosted configuration.
*/
readonly content: ConfigurationContent;
/**
* The latest version number of the hosted configuration.
*
* @default - None.
*/
readonly latestVersionNumber?: number;
/**
* The version label of the hosted configuration.
*
* @default - None.
*/
readonly versionLabel?: string;
/**
* The customer managed key to encrypt hosted configuration.
*
* @default None
*/
readonly kmsKey?: kms.IKeyRef;
}
/**
* A hosted configuration represents configuration stored in the AWS AppConfig hosted configuration store.
*/
export declare class HostedConfiguration extends ConfigurationBase {
/**
* The content of the hosted configuration.
*/
readonly content: string;
/**
* The configuration content type, specified as a standard MIME type.
* Supported examples include:
* - `text/plain`
* - `application/json`
* - `application/octet-stream`
* - `application/x-yaml`
*
* For an up-to-date list of valid MIME types, see:
* https://www.iana.org/assignments/media-types/media-types.xhtml
*/
readonly contentType?: string;
/**
* The latest version number of the hosted configuration.
*/
readonly latestVersionNumber?: number;
/**
* The version label of the hosted configuration.
*/
readonly versionLabel?: string;
/**
* The version number of the hosted configuration.
*/
readonly versionNumber?: string;
/**
* The Amazon Resource Name (ARN) of the hosted configuration version.
*/
readonly hostedConfigurationVersionArn: string;
/**
* The ID of the configuration profile.
*/
readonly configurationProfileId: string;
/**
* The Amazon Resource Name (ARN) of the configuration profile.
*/
readonly configurationProfileArn: string;
private readonly _cfnConfigurationProfile;
private readonly _cfnHostedConfigurationVersion;
constructor(scope: Construct, id: string, props: HostedConfigurationProps);
}
/**
* Options for SourcedConfiguration
*/
export interface SourcedConfigurationOptions extends ConfigurationOptions {
/**
* The location where the configuration is stored.
*/
readonly location: ConfigurationSource;
/**
* The version number of the sourced configuration to deploy. If this is not specified,
* then there will be no deployment.
*
* @default - None.
*/
readonly versionNumber?: string;
/**
* The IAM role to retrieve the configuration.
*
* @default - A role is generated.
*/
readonly retrievalRole?: iam.IRoleRef;
}
/**
* Properties for SourcedConfiguration.
*/
export interface SourcedConfigurationProps extends ConfigurationProps {
/**
* The location where the configuration is stored.
*/
readonly location: ConfigurationSource;
/**
* The version number of the sourced configuration to deploy. If this is not specified,
* then there will be no deployment.
*
* @default - None.
*/
readonly versionNumber?: string;
/**
* The IAM role to retrieve the configuration.
*
* @default - Auto generated if location type is not ConfigurationSourceType.CODE_PIPELINE otherwise no role specified.
*/
readonly retrievalRole?: iam.IRoleRef;
}
/**
* 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.
*/
export declare class SourcedConfiguration extends ConfigurationBase {
/**
* The location where the configuration is stored.
*/
readonly location: ConfigurationSource;
/**
* The version number of the configuration to deploy.
*/
readonly versionNumber?: string;
/**
* 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.
*/
readonly sourceKey?: kms.IKey;
/**
* The ID of the configuration profile.
*/
readonly configurationProfileId: string;
/**
* The Amazon Resource Name (ARN) of the configuration profile.
*/
readonly configurationProfileArn: string;
private readonly locationUri;
private readonly _cfnConfigurationProfile;
private readonly _retrievalRole?;
constructor(scope: Construct, id: string, props: SourcedConfigurationProps);
/**
* The IAM role to retrieve the configuration.
*/
get retrievalRole(): iam.IRole | undefined;
private getRetrievalRole;
private getPolicyForRole;
}
/**
* The configuration type.
*/
export declare enum ConfigurationType {
/**
* Freeform configuration profile. Allows you to store your data in the AWS AppConfig
* hosted configuration store or another Systems Manager capability or AWS service that integrates
* with AWS AppConfig.
*
* @see https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-free-form-configurations-creating.html
*/
FREEFORM = "AWS.Freeform",
/**
* Feature flag configuration profile. This configuration stores its data
* in the AWS AppConfig hosted configuration store and the URI is simply hosted.
*/
FEATURE_FLAGS = "AWS.AppConfig.FeatureFlags"
}
/**
* The validator type.
*/
export declare enum ValidatorType {
/**
* JSON Scema validator.
*/
JSON_SCHEMA = "JSON_SCHEMA",
/**
* Validate using a Lambda function.
*/
LAMBDA = "LAMBDA"
}
/**
* The configuration source type.
*/
export declare enum ConfigurationSourceType {
S3 = "S3",
SECRETS_MANAGER = "SECRETS_MANAGER",
SSM_PARAMETER = "SSM_PARAMETER",
SSM_DOCUMENT = "SSM_DOCUMENT",
CODE_PIPELINE = "CODE_PIPELINE"
}
export interface IValidator {
/**
* The content of the validator.
*/
readonly content: string;
/**
* The type of validator.
*/
readonly type: ValidatorType;
}
/**
* Defines a JSON Schema validator.
*/
export declare abstract class JsonSchemaValidator implements IValidator {
/**
* Defines a JSON Schema validator from a file.
*
* @param inputPath The path to the file that defines the validator
*/
static fromFile(inputPath: string): JsonSchemaValidator;
/**
* Defines a JSON Schema validator from inline code.
*
* @param code The inline code that defines the validator
*/
static fromInline(code: string): JsonSchemaValidator;
abstract readonly content: string;
abstract readonly type: ValidatorType;
}
/**
* Defines an AWS Lambda validator.
*/
export declare abstract class LambdaValidator implements IValidator {
/**
* Defines an AWS Lambda validator from a Lambda function. This will call
* `addPermission` to your function to grant AWS AppConfig permissions.
*
* @param func The function that defines the validator
*/
static fromFunction(func: lambda.Function): LambdaValidator;
abstract readonly content: string;
abstract readonly type: ValidatorType;
}
/**
* Defines the hosted configuration content.
*/
export declare abstract class ConfigurationContent {
/**
* Defines the hosted configuration content from a file.
*
* @param inputPath The path to the file that defines configuration content
* @param contentType The configuration content type, specified as a standard MIME type.
* Supported examples include:
* - `text/plain`
* - `application/json`
* - `application/octet-stream`
* - `application/x-yaml`
*
* For an up-to-date list of valid MIME types, see:
* https://www.iana.org/assignments/media-types/media-types.xhtml
*/
static fromFile(inputPath: string, contentType?: string): ConfigurationContent;
/**
* Defines the hosted configuration content from inline code.
*
* @param content The inline code that defines the configuration content
* @param contentType The configuration content type, specified as a standard MIME type.
* Supported examples include:
* - `text/plain`
* - `application/json`
* - `application/octet-stream`
* - `application/x-yaml`
*
* For an up-to-date list of valid MIME types, see:
* https://www.iana.org/assignments/media-types/media-types.xhtml
*/
static fromInline(content: string, contentType?: string): ConfigurationContent;
/**
* Defines the hosted configuration content as JSON from inline code.
*
* @param content The inline code that defines the configuration content
* @param contentType The configuration content type, specified as a standard MIME type.
* Supported examples include:
* - `text/plain`
* - `application/json`
* - `application/octet-stream`
* - `application/x-yaml`
*
* For an up-to-date list of valid MIME types, see:
* https://www.iana.org/assignments/media-types/media-types.xhtml
*/
static fromInlineJson(content: string, contentType?: string): ConfigurationContent;
/**
* Defines the hosted configuration content as text from inline code.
*
* @param content The inline code that defines the configuration content
*/
static fromInlineText(content: string): ConfigurationContent;
/**
* Defines the hosted configuration content as YAML from inline code.
*
* @param content The inline code that defines the configuration content
*/
static fromInlineYaml(content: string): ConfigurationContent;
/**
* The configuration content.
*/
abstract readonly content: string;
/**
* The configuration content type, specified as a standard MIME type.
* Supported examples include:
* - `text/plain`
* - `application/json`
* - `application/octet-stream`
* - `application/x-yaml`
*
* For an up-to-date list of valid MIME types, see:
* https://www.iana.org/assignments/media-types/media-types.xhtml
*/
abstract readonly contentType: string;
}
/**
* Defines the integrated configuration sources.
*/
export declare abstract class ConfigurationSource {
/**
* Defines configuration content from an Amazon S3 bucket.
*
* @param bucket The S3 bucket where the configuration is stored
* @param objectKey The path to the configuration
* @param key The KMS Key that the bucket is encrypted with
*/
static fromBucket(bucket: s3.IBucket, objectKey: string, key?: kms.IKey): ConfigurationSource;
/**
* Defines configuration content from an AWS Secrets Manager secret.
*
* @param secret The secret where the configuration is stored
*/
static fromSecret(secret: sm.ISecret): ConfigurationSource;
/**
* Defines configuration content from a Systems Manager (SSM) Parameter Store parameter.
*
* @param parameter The parameter where the configuration is stored
* @param key The KMS Key that the secure string is encrypted with
*/
static fromParameter(parameter: ssm.IParameter, key?: kms.IKey): ConfigurationSource;
/**
* Defines configuration content from a Systems Manager (SSM) document.
*
* @param document The SSM document where the configuration is stored
*/
static fromCfnDocument(document: ssm.CfnDocument): ConfigurationSource;
/**
* Defines configuration content from AWS CodePipeline.
*
* @param pipeline The pipeline where the configuration is stored
*/
static fromPipeline(pipeline: cp.IPipelineRef): ConfigurationSource;
/**
* The URI of the configuration source.
*/
abstract readonly locationUri: string;
/**
* The type of the configuration source.
*/
abstract readonly type: ConfigurationSourceType;
/**
* The KMS Key that encrypts the configuration.
*/
abstract readonly key?: kms.IKey;
}
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,263 @@
import type { Construct } from 'constructs';
import type { IResource } from '../../core';
import { Resource, Duration } from '../../core';
import type { IDeploymentStrategyRef, DeploymentStrategyReference } from '../../interfaces/generated/aws-appconfig-interfaces.generated';
/**
* Properties for DeploymentStrategy.
*/
export interface DeploymentStrategyProps {
/**
* The rollout strategy for the deployment strategy. You can use predefined deployment
* strategies, such as RolloutStrategy.ALL_AT_ONCE, RolloutStrategy.LINEAR_50_PERCENT_EVERY_30_SECONDS,
* or RolloutStrategy.CANARY_10_PERCENT_20_MINUTES.
*/
readonly rolloutStrategy: RolloutStrategy;
/**
* A name for the deployment strategy.
*
* @default - A name is generated.
*/
readonly deploymentStrategyName?: string;
/**
* A description of the deployment strategy.
*
* @default - No description.
*/
readonly description?: string;
}
/**
* An AWS AppConfig deployment strategy.
*
* @resource AWS::AppConfig::DeploymentStrategy
* @see https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-deployment-strategy.html
*/
export declare class DeploymentStrategy extends Resource implements IDeploymentStrategy {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
get deploymentStrategyRef(): DeploymentStrategyReference;
/**
* Imports a deployment strategy into the CDK using its Amazon Resource Name (ARN).
*
* @param scope The parent construct
* @param id The name of the deployment strategy construct
* @param deploymentStrategyArn The Amazon Resource Name (ARN) of the deployment strategy
*/
static fromDeploymentStrategyArn(scope: Construct, id: string, deploymentStrategyArn: string): IDeploymentStrategy;
/**
* Imports a deployment strategy into the CDK using its ID.
*
* @param scope The parent construct
* @param id The name of the deployment strategy construct
* @param deploymentStrategyId The ID of the deployment strategy
*/
static fromDeploymentStrategyId(scope: Construct, id: string, deploymentStrategyId: DeploymentStrategyId): IDeploymentStrategy;
/**
* The name of the deployment strategy.
*/
readonly name?: string;
/**
* The deployment duration in minutes of the deployment strategy.
*/
readonly deploymentDurationInMinutes?: number;
/**
* The growth factor of the deployment strategy.
*/
readonly growthFactor?: number;
/**
* The description of the deployment strategy.
*/
readonly description?: string;
/**
* The final bake time in minutes of the deployment strategy.
*/
readonly finalBakeTimeInMinutes?: number;
/**
* The growth type of the deployment strategy.
*/
readonly growthType?: GrowthType;
/**
* The ID of the deployment strategy.
*/
readonly deploymentStrategyId: string;
/**
* The Amazon Resource Name (ARN) of the deployment strategy.
*
* @attribute
*/
readonly deploymentStrategyArn: string;
private readonly _cfnDeploymentStrategy;
constructor(scope: Construct, id: string, props: DeploymentStrategyProps);
}
/**
* Defines the growth type of the deployment strategy.
*/
export declare enum GrowthType {
/**
* AWS AppConfig will process the deployment by increments of the growth factor
* evenly distributed over the deployment.
*/
LINEAR = "LINEAR",
/**
* AWS AppConfig will process the deployment exponentially using the following formula:
* `G*(2^N)`. In this formula, `G` is the step percentage specified by the user and `N`
* is the number of steps until the configuration is deployed to all targets.
*/
EXPONENTIAL = "EXPONENTIAL"
}
/**
* Defines the deployment strategy ID's of AWS AppConfig deployment strategies.
*
* @see https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-deployment-strategy.html
*/
export declare abstract class DeploymentStrategyId {
/**
* **AWS Recommended**. This strategy processes the deployment exponentially using a 10% growth factor over 20 minutes.
* AWS AppConfig recommends using this strategy for production deployments because it aligns with AWS best practices
* for configuration deployments.
*/
static readonly CANARY_10_PERCENT_20_MINUTES: DeploymentStrategyId;
/**
* **Testing/Demonstration**. This strategy deploys the configuration to half of all targets every 30 seconds for a
* one-minute deployment. AWS AppConfig recommends using this strategy only for testing or demonstration purposes because
* it has a short duration and bake time.
*/
static readonly LINEAR_50_PERCENT_EVERY_30_SECONDS: DeploymentStrategyId;
/**
* **AWS Recommended**. This strategy deploys the configuration to 20% of all targets every six minutes for a 30 minute deployment.
* AWS AppConfig recommends using this strategy for production deployments because it aligns with AWS best practices
* for configuration deployments.
*/
static readonly LINEAR_20_PERCENT_EVERY_6_MINUTES: DeploymentStrategyId;
/**
* **Quick**. This strategy deploys the configuration to all targets immediately.
*/
static readonly ALL_AT_ONCE: DeploymentStrategyId;
/**
* Builds a deployment strategy ID from a string.
*
* @param deploymentStrategyId The deployment strategy ID.
*/
static fromString(deploymentStrategyId: string): DeploymentStrategyId;
/**
* The deployment strategy ID.
*/
abstract readonly id: string;
}
/**
* Properties for the Rollout Strategy.
*/
export interface RolloutStrategyProps {
/**
* The growth factor of the deployment strategy. This defines
* the percentage of targets to receive a deployed configuration
* during each interval.
*/
readonly growthFactor: number;
/**
* The deployment duration of the deployment strategy. This defines
* the total amount of time for a deployment to last.
*/
readonly deploymentDuration: Duration;
/**
* The final bake time of the deployment strategy.
*
* This setting specifies the amount of time AWS AppConfig monitors for Amazon
* CloudWatch alarms after the configuration has been deployed to
* 100% of its targets, before considering the deployment to be complete.
* If an alarm is triggered during this time, AWS AppConfig rolls back
* the deployment.
*
* @default Duration.minutes(0)
*/
readonly finalBakeTime?: Duration;
}
/**
* Defines the rollout strategy for a deployment strategy and includes the growth factor,
* deployment duration, growth type, and optionally final bake time.
*
* @see https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-deployment-strategy.html
*/
export declare abstract class RolloutStrategy {
/**
* **AWS Recommended**. This strategy processes the deployment exponentially using a 10% growth factor over 20 minutes.
* AWS AppConfig recommends using this strategy for production deployments because it aligns with AWS best practices
* for configuration deployments.
*/
static readonly CANARY_10_PERCENT_20_MINUTES: RolloutStrategy;
/**
* **Testing/Demonstration**. This strategy deploys the configuration to half of all targets every 30 seconds for a
* one-minute deployment. AWS AppConfig recommends using this strategy only for testing or demonstration purposes because
* it has a short duration and bake time.
*/
static readonly LINEAR_50_PERCENT_EVERY_30_SECONDS: RolloutStrategy;
/**
* **AWS Recommended**. This strategy deploys the configuration to 20% of all targets every six minutes for a 30 minute deployment.
* AWS AppConfig recommends using this strategy for production deployments because it aligns with AWS best practices
* for configuration deployments.
*/
static readonly LINEAR_20_PERCENT_EVERY_6_MINUTES: RolloutStrategy;
/**
* **Quick**. This strategy deploys the configuration to all targets immediately.
*/
static readonly ALL_AT_ONCE: RolloutStrategy;
/**
* Build your own linear rollout strategy.
*/
static linear(props: RolloutStrategyProps): RolloutStrategy;
/**
* Build your own exponential rollout strategy.
*/
static exponential(props: RolloutStrategyProps): RolloutStrategy;
/**
* The growth factor of the rollout strategy.
*/
abstract readonly growthFactor: number;
/**
* The deployment duration of the rollout strategy.
*/
abstract readonly deploymentDuration: Duration;
/**
* The growth type of the rollout strategy.
*/
abstract readonly growthType?: GrowthType;
/**
* The final bake time of the deployment strategy.
*/
abstract readonly finalBakeTime?: Duration;
}
export interface IDeploymentStrategy extends IResource, IDeploymentStrategyRef {
/**
* The name of the deployment strategy.
*/
readonly name?: string;
/**
* The deployment duration in minutes.
*/
readonly deploymentDurationInMinutes?: number;
/**
* The growth factor of the deployment strategy.
*/
readonly growthFactor?: number;
/**
* The description of the deployment strategy.
*/
readonly description?: string;
/**
* The final bake time in minutes.
*/
readonly finalBakeTimeInMinutes?: number;
/**
* The growth type of the deployment strategy.
*/
readonly growthType?: GrowthType;
/**
* The ID of the deployment strategy.
* @attribute
*/
readonly deploymentStrategyId: string;
/**
* The Amazon Resource Name (ARN) of the deployment strategy.
* @attribute
*/
readonly deploymentStrategyArn: string;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,363 @@
import type { Construct } from 'constructs';
import { CfnDeployment, CfnEnvironment } from './appconfig.generated';
import type { IApplication } from './application';
import type { IConfiguration } from './configuration';
import type { ActionPoint, IEventDestination, ExtensionOptions, IExtension, IExtensible } from './extension';
import { ExtensibleBase } from './extension';
import type { DeletionProtectionCheck } from './util';
import * as iam from '../../aws-iam';
import type { IResource } from '../../core';
import { Resource } from '../../core';
import type { IEnvironmentRef, EnvironmentReference } from '../../interfaces/generated/aws-appconfig-interfaces.generated';
import type { IAlarmRef } from '../../interfaces/generated/aws-cloudwatch-interfaces.generated';
/**
* Attributes of an existing AWS AppConfig environment to import it.
*/
export interface EnvironmentAttributes {
/**
* The application associated with the environment.
*/
readonly application: IApplication;
/**
* The ID of the environment.
*/
readonly environmentId: string;
/**
* The name of the environment.
*
* @default - None.
*/
readonly name?: string;
/**
* The description of the environment.
*
* @default - None.
*/
readonly description?: string;
/**
* The monitors for the environment.
*
* @default - None.
*/
readonly monitors?: Monitor[];
}
declare abstract class EnvironmentBase extends Resource implements IEnvironment, IExtensible {
abstract applicationId: string;
abstract environmentId: string;
abstract environmentArn: string;
abstract name?: string;
protected extensible: ExtensibleBase;
protected deploymentQueue: Array<CfnDeployment>;
get environmentRef(): EnvironmentReference;
addDeployment(configuration: IConfiguration): void;
addDeployments(...configurations: IConfiguration[]): void;
on(actionPoint: ActionPoint, eventDestination: IEventDestination, options?: ExtensionOptions): void;
preCreateHostedConfigurationVersion(eventDestination: IEventDestination, options?: ExtensionOptions): void;
preStartDeployment(eventDestination: IEventDestination, options?: ExtensionOptions): void;
onDeploymentStart(eventDestination: IEventDestination, options?: ExtensionOptions): void;
onDeploymentStep(eventDestination: IEventDestination, options?: ExtensionOptions): void;
onDeploymentBaking(eventDestination: IEventDestination, options?: ExtensionOptions): void;
onDeploymentComplete(eventDestination: IEventDestination, options?: ExtensionOptions): void;
onDeploymentRolledBack(eventDestination: IEventDestination, options?: ExtensionOptions): void;
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): void;
addExtension(extension: IExtension): void;
/**
* [disable-awslint:no-grants]
*/
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* [disable-awslint:no-grants]
*/
grantReadConfig(identity: iam.IGrantable): iam.Grant;
}
/**
* Options for the Environment construct.
*/
export interface EnvironmentOptions {
/**
* The name of the environment.
*
* @default - A name is generated.
*/
readonly environmentName?: string;
/**
* The description of the environment.
*
* @default - No description.
*/
readonly description?: string;
/**
* The monitors for the environment.
*
* @default - No monitors.
*/
readonly monitors?: Monitor[];
/**
* A property to prevent accidental deletion of active environments.
*
* @default undefined - AppConfig default is ACCOUNT_DEFAULT
*/
readonly deletionProtectionCheck?: DeletionProtectionCheck;
}
/**
* Properties for the Environment construct.
*/
export interface EnvironmentProps extends EnvironmentOptions {
/**
* The application to be associated with the environment.
*/
readonly application: IApplication;
}
/**
* An AWS AppConfig environment.
* [disable-awslint:no-grants]
*
* @resource AWS::AppConfig::Environment
* @see https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-environment.html
*/
export declare class Environment extends EnvironmentBase {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
/**
* Imports an environment into the CDK using its Amazon Resource Name (ARN).
*
* @param scope The parent construct
* @param id The name of the environment construct
* @param environmentArn The Amazon Resource Name (ARN) of the environment
*/
static fromEnvironmentArn(scope: Construct, id: string, environmentArn: string): IEnvironment;
/**
* Imports an environment into the CDK from its attributes.
*
* @param scope The parent construct
* @param id The name of the environment construct
* @param attrs The attributes of the environment
*/
static fromEnvironmentAttributes(scope: Construct, id: string, attrs: EnvironmentAttributes): IEnvironment;
/**
* The application associated with the environment.
*/
readonly application?: IApplication;
/**
* The name of the environment.
*/
readonly name?: string;
/**
* The description of the environment.
*/
readonly description?: string;
/**
* The monitors for the environment.
*/
readonly monitors?: Monitor[];
/**
* The ID of the environment.
*
* @attribute
*/
readonly environmentId: string;
/**
* The Amazon Resource Name (ARN) of the environment.
*
* @attribute
*/
readonly environmentArn: string;
/**
* The ID of the environment.
*/
readonly applicationId: string;
private readonly _cfnEnvironment;
constructor(scope: Construct, id: string, props: EnvironmentProps);
private createOrGetAlarmRole;
}
/**
* The type of Monitor.
*/
export declare enum MonitorType {
/**
* A Monitor from a CloudWatch alarm.
*/
CLOUDWATCH = 0,
/**
* A Monitor from a CfnEnvironment.MonitorsProperty construct.
*/
CFN_MONITORS_PROPERTY = 1
}
/**
* Defines monitors that will be associated with an AWS AppConfig environment.
*/
export declare abstract class Monitor {
/**
* Creates a Monitor from a CloudWatch alarm. If the alarm role is not specified, a role will
* be generated.
*
* @param alarm The Amazon CloudWatch alarm.
* @param alarmRole The IAM role for AWS AppConfig to view the alarm state.
*/
static fromCloudWatchAlarm(alarm: IAlarmRef, alarmRole?: iam.IRoleRef): Monitor;
/**
* Creates a Monitor from a CfnEnvironment.MonitorsProperty construct.
*
* @param monitorsProperty The monitors property.
*/
static fromCfnMonitorsProperty(monitorsProperty: CfnEnvironment.MonitorsProperty): Monitor;
/**
* The alarm ARN for AWS AppConfig to monitor.
*/
abstract readonly alarmArn: string;
/**
* The type of monitor.
*/
abstract readonly monitorType: MonitorType;
/**
* The IAM role ARN for AWS AppConfig to view the alarm state.
*/
abstract readonly alarmRoleArn?: string;
/**
* Indicates whether a CloudWatch alarm is a composite alarm.
*/
abstract readonly isCompositeAlarm?: boolean;
}
export interface IEnvironment extends IResource, IEnvironmentRef {
/**
* The application associated with the environment.
*/
readonly application?: IApplication;
/**
* The ID of the application associated to the environment.
*/
readonly applicationId: string;
/**
* The name of the environment.
*/
readonly name?: string;
/**
* The description of the environment.
*/
readonly description?: string;
/**
* The monitors for the environment.
*/
readonly monitors?: Monitor[];
/**
* The ID of the environment.
* @attribute
*/
readonly environmentId: string;
/**
* The Amazon Resource Name (ARN) of the environment.
* @attribute
*/
readonly environmentArn: string;
/**
* Creates a deployment of the supplied configuration to this environment.
* Note that you can only deploy one configuration at a time to an environment.
* However, you can deploy one configuration each to different environments at the same time.
* If more than one deployment is requested for this environment, they will occur in the same order they were provided.
*
* @param configuration The configuration that will be deployed to this environment.
*/
addDeployment(configuration: IConfiguration): void;
/**
* Creates a deployment for each of the supplied configurations to this environment.
* These configurations will be deployed in the same order as the input array.
*
* @param configurations The configurations that will be deployed to this environment.
*/
addDeployments(...configurations: Array<IConfiguration>): void;
/**
* Adds an extension defined by the action point and event destination and also
* creates an extension association to the environment.
*
* @param actionPoint The action point which triggers the event
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
on(actionPoint: ActionPoint, 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 environment.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
preCreateHostedConfigurationVersion(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds a PRE_START_DEPLOYMENT extension with the provided event destination and also creates
* an extension association to the environment.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
preStartDeployment(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_START extension with the provided event destination and also creates
* an extension association to the environment.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentStart(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_STEP extension with the provided event destination and also
* creates an extension association to the environment.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentStep(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_BAKING extension with the provided event destination and
* also creates an extension association to the environment.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentBaking(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_COMPLETE extension with the provided event destination and
* also creates an extension association to the environment.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentComplete(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 environment.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentRolledBack(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.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an extension association to the environment.
*
* @param extension The extension to create an association for
*/
addExtension(extension: IExtension): void;
/**
* Adds an IAM policy statement associated with this environment to an IAM principal's policy.
*
* @param grantee the principal (no-op if undefined)
* @param actions the set of actions to allow (i.e., 'appconfig:GetLatestConfiguration', 'appconfig:StartConfigurationSession', etc.)
*/
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Permits an IAM principal to perform read operations on this environment's configurations.
*
* Actions: GetLatestConfiguration, StartConfigurationSession.
*
* @param grantee Principal to grant read rights to
*/
grantReadConfig(grantee: iam.IGrantable): iam.Grant;
}
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,489 @@
import type { Construct } from 'constructs';
import type * as events from '../../aws-events';
import * as iam from '../../aws-iam';
import type * as lambda from '../../aws-lambda';
import type * as sns from '../../aws-sns';
import type * as sqs from '../../aws-sqs';
import type { IResource } from '../../core';
import { Resource } from '../../core';
import type { IExtensionRef, ExtensionReference } from '../../interfaces/generated/aws-appconfig-interfaces.generated';
/**
* Defines Extension action points.
*
* @see https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions-about.html#working-with-appconfig-extensions-how-it-works-step-2
*/
export declare enum ActionPoint {
PRE_CREATE_HOSTED_CONFIGURATION_VERSION = "PRE_CREATE_HOSTED_CONFIGURATION_VERSION",
PRE_START_DEPLOYMENT = "PRE_START_DEPLOYMENT",
ON_DEPLOYMENT_START = "ON_DEPLOYMENT_START",
ON_DEPLOYMENT_STEP = "ON_DEPLOYMENT_STEP",
ON_DEPLOYMENT_BAKING = "ON_DEPLOYMENT_BAKING",
ON_DEPLOYMENT_COMPLETE = "ON_DEPLOYMENT_COMPLETE",
ON_DEPLOYMENT_ROLLED_BACK = "ON_DEPLOYMENT_ROLLED_BACK",
AT_DEPLOYMENT_TICK = "AT_DEPLOYMENT_TICK"
}
/**
* Defines the source type for event destinations.
*/
export declare enum SourceType {
LAMBDA = "lambda",
SQS = "sqs",
SNS = "sns",
EVENTS = "events"
}
/**
* Implemented by allowed extension event destinations.
*/
export interface IEventDestination {
/**
* The URI of the extension event destination.
*/
readonly extensionUri: string;
/**
* The type of the extension event destination.
*/
readonly type: SourceType;
/**
* The IAM policy document to invoke the event destination.
*/
readonly policyDocument?: iam.PolicyDocument;
}
/**
* Use an AWS Lambda function as an event destination.
*/
export declare class LambdaDestination implements IEventDestination {
readonly extensionUri: string;
readonly type: SourceType;
readonly policyDocument?: iam.PolicyDocument;
constructor(func: lambda.IFunction);
}
/**
* Use an Amazon SQS queue as an event destination.
*/
export declare class SqsDestination implements IEventDestination {
readonly extensionUri: string;
readonly type: SourceType;
readonly policyDocument?: iam.PolicyDocument;
constructor(queue: sqs.IQueue);
}
/**
* Use an Amazon SNS topic as an event destination.
*/
export declare class SnsDestination implements IEventDestination {
readonly extensionUri: string;
readonly type: SourceType;
readonly policyDocument?: iam.PolicyDocument;
constructor(topic: sns.ITopic);
}
/**
* Use an Amazon EventBridge event bus as an event destination.
*/
export declare class EventBridgeDestination implements IEventDestination {
readonly extensionUri: string;
readonly type: SourceType;
constructor(bus: events.IEventBusRef);
}
/**
* Properties for the Action construct
*/
export interface ActionProps {
/**
* The action points that will trigger the extension action.
*/
readonly actionPoints: ActionPoint[];
/**
* The event destination for the action.
*/
readonly eventDestination: IEventDestination;
/**
* The name for the action.
*
* @default - A name is generated.
*/
readonly name?: string;
/**
* The execution role for the action.
*
* @default - A role is generated.
*/
readonly executionRole?: iam.IRole;
/**
* The description for the action.
*
* @default - No description.
*/
readonly description?: string;
/**
* The flag that specifies whether or not to create the execution role.
*
* If set to true, then the role will not be auto-generated under the assumption
* there is already the corresponding resource-based policy attached to the event
* destination. If false, the execution role will be generated if not provided.
*
* @default false
*/
readonly invokeWithoutExecutionRole?: boolean;
}
/**
* Defines an action for an extension.
*/
export declare class Action {
/**
* The action points that will trigger the extension action.
*/
readonly actionPoints: ActionPoint[];
/**
* The event destination for the action.
*/
readonly eventDestination: IEventDestination;
/**
* The name for the action.
*/
readonly name?: string;
/**
* The execution role for the action.
*/
readonly executionRole?: iam.IRole;
/**
* The description for the action.
*/
readonly description?: string;
/**
* The flag that specifies whether to create the execution role.
*/
readonly invokeWithoutExecutionRole?: boolean;
constructor(props: ActionProps);
}
/**
* Defines a parameter for an extension.
*/
export declare class Parameter {
/**
* A required parameter for an extension.
*
* @param name The name of the parameter
* @param value The value of the parameter
* @param description A description for the parameter
*/
static required(name: string, value: string, description?: string): Parameter;
/**
* An optional parameter for an extension.
*
* @param name The name of the parameter
* @param value The value of the parameter
* @param description A description for the parameter
*/
static notRequired(name: string, value?: string, description?: string): Parameter;
/**
* The name of the parameter.
*/
readonly name: string;
/**
* A boolean that indicates if the parameter is required or optional.
*/
readonly isRequired: boolean;
/**
* The value of the parameter.
*/
readonly value?: string;
/**
* The description of the parameter.
*/
readonly description?: string;
private constructor();
}
/**
* Attributes of an existing AWS AppConfig extension to import.
*/
export interface ExtensionAttributes {
/**
* The ID of the extension.
*/
readonly extensionId: string;
/**
* The version number of the extension.
*/
readonly extensionVersionNumber: number;
/**
* The Amazon Resource Name (ARN) of the extension.
*
* @default - The extension ARN is generated.
*/
readonly extensionArn?: string;
/**
* The actions of the extension.
*
* @default - None.
*/
readonly actions?: Action[];
/**
* The name of the extension.
*
* @default - None.
*/
readonly name?: string;
/**
* The description of the extension.
*
* @default - None.
*/
readonly description?: string;
}
/**
* Options for the Extension construct.
*/
export interface ExtensionOptions {
/**
* The name of the extension.
*
* @default - A name is generated.
*/
readonly extensionName?: string;
/**
* A description of the extension
*
* @default - No description.
*/
readonly description?: string;
/**
* The latest version number of the extension. When you create a new version,
* specify the most recent current version number. For example, you create version 3,
* enter 2 for this field.
*
* @default - None.
*/
readonly latestVersionNumber?: number;
/**
* The parameters accepted for the extension.
*
* @default - None.
*/
readonly parameters?: Parameter[];
}
/**
* Properties for the Extension construct.
*/
export interface ExtensionProps extends ExtensionOptions {
/**
* The actions for the extension.
*/
readonly actions: Action[];
}
/**
* An AWS AppConfig extension.
*
* @resource AWS::AppConfig::Extension
* @see https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html
*/
export declare class Extension extends Resource implements IExtension {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
get extensionRef(): ExtensionReference;
/**
* Imports an extension into the CDK using its Amazon Resource Name (ARN).
*
* @param scope The parent construct
* @param id The name of the extension construct
* @param extensionArn The Amazon Resource Name (ARN) of the extension
*/
static fromExtensionArn(scope: Construct, id: string, extensionArn: string): IExtension;
/**
* Imports an extension into the CDK using its attributes.
*
* @param scope The parent construct
* @param id The name of the extension construct
* @param attrs The attributes of the extension
*/
static fromExtensionAttributes(scope: Construct, id: string, attrs: ExtensionAttributes): IExtension;
/**
* The actions for the extension.
*/
readonly actions?: Action[];
/**
* The name of the extension.
*/
readonly name?: string;
/**
* The description of the extension.
*/
readonly description?: string;
/**
* The latest version number of the extension.
*/
readonly latestVersionNumber?: number;
/**
* The parameters of the extension.
*/
readonly parameters?: Parameter[];
/**
* The Amazon Resource Name (ARN) of the extension.
*
* @attribute
*/
get extensionArn(): string;
/**
* The ID of the extension.
*
* @attribute
*/
readonly extensionId: string;
/**
* The version number of the extension.
*
* @attribute
*/
readonly extensionVersionNumber: number;
private readonly _cfnExtension;
private executionRole?;
constructor(scope: Construct, id: string, props: ExtensionProps);
private getExecutionRole;
}
export interface IExtension extends IResource, IExtensionRef {
/**
* The actions for the extension.
*/
readonly actions?: Action[];
/**
* The name of the extension.
*/
readonly name?: string;
/**
* The description of the extension.
*/
readonly description?: string;
/**
* The latest version number of the extension.
*/
readonly latestVersionNumber?: number;
/**
* The parameters of the extension.
*/
readonly parameters?: Parameter[];
/**
* The Amazon Resource Name (ARN) of the extension.
* @attribute
*/
readonly extensionArn: string;
/**
* The ID of the extension.
* @attribute
*/
readonly extensionId: string;
/**
* The version number of the extension.
* @attribute
*/
readonly extensionVersionNumber: number;
}
/**
* This class is meant to be used by AWS AppConfig resources (application,
* configuration profile, environment) directly. There is currently no use
* for this class outside of the AWS AppConfig construct implementation. It is
* intended to be used with the resources since there is currently no way to
* inherit from two classes (at least within JSII constraints).
*/
export declare class ExtensibleBase implements IExtensible {
private resourceArn;
private resourceName?;
private scope;
constructor(scope: Construct, resourceArn: string, resourceName?: string);
on(actionPoint: ActionPoint, eventDestination: IEventDestination, options?: ExtensionOptions): void;
preCreateHostedConfigurationVersion(eventDestination: IEventDestination, options?: ExtensionOptions): void;
preStartDeployment(eventDestination: IEventDestination, options?: ExtensionOptions): void;
onDeploymentStart(eventDestination: IEventDestination, options?: ExtensionOptions): void;
onDeploymentStep(eventDestination: IEventDestination, options?: ExtensionOptions): void;
onDeploymentBaking(eventDestination: IEventDestination, options?: ExtensionOptions): void;
onDeploymentComplete(eventDestination: IEventDestination, options?: ExtensionOptions): void;
onDeploymentRolledBack(eventDestination: IEventDestination, options?: ExtensionOptions): void;
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): void;
addExtension(extension: IExtension): void;
private getExtensionForActionPoint;
private addExtensionAssociation;
private getExtensionHash;
private getExtensionAssociationHash;
private getExtensionDefaultName;
}
/**
* Defines the extensible base implementation for extension association resources.
*/
export interface IExtensible {
/**
* Adds an extension defined by the action point and event destination and
* also creates an extension association to the derived resource.
*
* @param actionPoint The action point which triggers the event
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
on(actionPoint: ActionPoint, 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 derived resource.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
preCreateHostedConfigurationVersion(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds a PRE_START_DEPLOYMENT extension with the provided event destination and
* also creates an extension association to the derived resource.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
preStartDeployment(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_START extension with the provided event destination and
* also creates an extension association to the derived resource.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentStart(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_STEP extension with the provided event destination and
* also creates an extension association to the derived resource.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentStep(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_BAKING extension with the provided event destination and
* also creates an extension association to the derived resource.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentBaking(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an ON_DEPLOYMENT_COMPLETE extension with the provided event destination and
* also creates an extension association to the derived resource.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentComplete(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 derived resource.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
onDeploymentRolledBack(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an AT_DEPLOYMENT_TICK extension with the provided event destination and
* also creates an extension association to the derived resource.
*
* @param eventDestination The event that occurs during the extension
* @param options Options for the extension
*/
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): void;
/**
* Adds an extension association to the derived resource.
*
* @param extension The extension to create an association for
*/
addExtension(extension: IExtension): void;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
export * from './environment';
export * from './deployment-strategy';
export * from './extension';
export * from './application';
export * from './configuration';
export * from './util';
export * from './appconfig.generated';

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
export declare function getHash(stringToHash: string): string;
export declare function stringifyObjects(...objects: any[]): string;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getHash=getHash,exports.stringifyObjects=stringifyObjects;var crypto=()=>{var tmp=require("crypto");return crypto=()=>tmp,tmp};function getHash(stringToHash){return crypto().createHash("sha256").update(stringToHash).digest("hex").substring(0,5).toUpperCase()}function stringifyObjects(...objects){const combinedObject=Object.assign({},...objects);return JSON.stringify(combinedObject)}

View File

@@ -0,0 +1,11 @@
import type { IDeploymentStrategyRef, IEnvironmentRef } from '../../../interfaces/generated/aws-appconfig-interfaces.generated';
import type { IDeploymentStrategy } from '../deployment-strategy';
import type { IEnvironment } from '../environment';
/**
* Converts an IEnvironmentRef to IEnvironment, with runtime type checking
*/
export declare function toIEnvironment(environment: IEnvironmentRef): IEnvironment;
/**
* Converts an IDeploymentStrategyRef to IDeploymentStrategy, with runtime type checking
*/
export declare function toIDeploymentStrategy(deploymentStrategy: IDeploymentStrategyRef): IDeploymentStrategy;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.toIEnvironment=toIEnvironment,exports.toIDeploymentStrategy=toIDeploymentStrategy;var core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};function toIEnvironment(environment){if("addDeployment"in environment&&"applicationId"in environment&&"environmentId"in environment)return environment;throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`InvalidEnvironmentInterface`,`'environment' instance should implement IEnvironment, but doesn't: ${environment.constructor.name}`)}function toIDeploymentStrategy(deploymentStrategy){if("deploymentStrategyId"in deploymentStrategy&&"deploymentStrategyArn"in deploymentStrategy)return deploymentStrategy;throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`InvalidDeploymentStrategyInterface`,`'deploymentStrategy' instance should implement IDeploymentStrategy, but doesn't: ${deploymentStrategy.constructor.name}`)}

View File

@@ -0,0 +1,23 @@
/**
* The deletion protection check options.
*/
export declare enum DeletionProtectionCheck {
/**
* The default setting,
* which uses account-level deletion protection. To configure account-level deletion protection, use the UpdateAccountSettings API.
*/
ACCOUNT_DEFAULT = "ACCOUNT_DEFAULT",
/**
* Instructs the deletion protection check to run,
* even if deletion protection is disabled at the account level.
*
* APPLY also forces the deletion protection check to run against resources created in the past hour,
* which are normally excluded from deletion protection checks.
*/
APPLY = "APPLY",
/**
* Instructs AWS AppConfig to bypass the deletion protection check and delete an environment or a configuration profile
* even if deletion protection would have otherwise prevented it.
*/
BYPASS = "BYPASS"
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DeletionProtectionCheck=void 0;var DeletionProtectionCheck;(function(DeletionProtectionCheck2){DeletionProtectionCheck2.ACCOUNT_DEFAULT="ACCOUNT_DEFAULT",DeletionProtectionCheck2.APPLY="APPLY",DeletionProtectionCheck2.BYPASS="BYPASS"})(DeletionProtectionCheck||(exports.DeletionProtectionCheck=DeletionProtectionCheck={}));