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

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={}));