Skip to content
v2.274.0

HostedConfiguration ​

A hosted configuration represents configuration stored in the AWS AppConfig hosted configuration store.

Example ​

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),
  ],
});
python
# application: appconfig.Application
# fn: lambda.Function


appconfig.HostedConfiguration(self, "MyHostedConfiguration",
    application=application,
    content=appconfig.ConfigurationContent.from_inline_text("This is my configuration content."),
    validators=[
        appconfig.JsonSchemaValidator.from_file("schema.json"),
        appconfig.LambdaValidator.from_function(fn)
    ]
)
java
Application application;
Function fn;


HostedConfiguration.Builder.create(this, "MyHostedConfiguration")
        .application(application)
        .content(ConfigurationContent.fromInlineText("This is my configuration content."))
        .validators(List.of(JsonSchemaValidator.fromFile("schema.json"), LambdaValidator.fromFunction(fn)))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Application application;
Function fn;


new HostedConfiguration(this, "MyHostedConfiguration", new HostedConfigurationProps {
    Application = application,
    Content = ConfigurationContent.FromInlineText("This is my configuration content."),
    Validators = new [] { JsonSchemaValidator.FromFile("schema.json"), LambdaValidator.FromFunction(fn) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var application Application
var fn Function


appconfig.NewHostedConfiguration(this, jsii.String("MyHostedConfiguration"), &HostedConfigurationProps{
	Application: Application,
	Content: appconfig.ConfigurationContent_FromInlineText(jsii.String("This is my configuration content.")),
	Validators: []IValidator{
		appconfig.JsonSchemaValidator_FromFile(jsii.String("schema.json")),
		appconfig.LambdaValidator_FromFunction(fn),
	},
})

Initializer ​

ts
new HostedConfiguration(scope: Construct, id: string, props: HostedConfigurationProps)
python
HostedConfiguration(scope: Construct, id: str, props: HostedConfigurationProps)
java
new HostedConfiguration(Construct scope, String id, HostedConfigurationProps props)
csharp
new HostedConfiguration(Construct scope, string id, HostedConfigurationProps props)
go
NewHostedConfiguration(Scope Construct, Id *string, Props HostedConfigurationProps)

Construct Props ​

applicationIApplicationapplicationIApplicationapplicationIApplicationApplicationIApplicationApplicationIApplicationrequired#
The application associated with the configuration.
The content of the hosted configuration.
deletionProtectionCheckoptionalDeletionProtectionCheckdeletion_protection_checkoptionalDeletionProtectionCheckdeletionProtectionCheckoptionalDeletionProtectionCheckDeletionProtectionCheckoptionalDeletionProtectionCheckDeletionProtectionCheckoptionalDeletionProtectionCheck#
A parameter to configure deletion protection.

Default: DeletionProtectionCheck.ACCOUNT_DEFAULT

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

deploymentKeyoptionalIKeydeployment_keyoptionalIKeydeploymentKeyoptionalIKeyDeploymentKeyoptionalIKeyDeploymentKeyoptionalIKey= None.#
The deployment key of the configuration.
deploymentStrategyoptionalIDeploymentStrategyRefdeployment_strategyoptionalIDeploymentStrategyRefdeploymentStrategyoptionalIDeploymentStrategyRefDeploymentStrategyoptionalIDeploymentStrategyRefDeploymentStrategyoptionalIDeploymentStrategyRef#
The deployment strategy for the configuration.

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

deployTooptionalIEnvironment[]deploy_tooptionaltyping.List[IEnvironment]deployTooptionalList<IEnvironment>DeployTooptionalIEnvironment[]DeployTooptional*[]IEnvironment= None.#
The list of environments to deploy the configuration to.

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

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

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
The description of the configuration.

Default: No description.

kmsKeyoptionalIKeyRefkms_keyoptionalIKeyRefkmsKeyoptionalIKeyRefKmsKeyoptionalIKeyRefKmsKeyoptionalIKeyRef= None#
The customer managed key to encrypt hosted configuration.
latestVersionNumberoptionalnumberlatest_version_numberoptionalint | floatlatestVersionNumberoptionalNumberLatestVersionNumberoptionaldoubleLatestVersionNumberoptional*float64= None.#
The latest version number of the hosted configuration.
nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string#
The name of the configuration.

Default: A name is generated.

typeoptionalConfigurationTypetypeoptionalConfigurationTypetypeoptionalConfigurationTypeTypeoptionalConfigurationTypeTypeoptionalConfigurationType= ConfigurationType.FREEFORM#
The type of configuration.
validatorsoptionalIValidator[]validatorsoptionaltyping.List[IValidator]validatorsoptionalList<IValidator>ValidatorsoptionalIValidator[]Validatorsoptional*[]IValidator#
The validators for the configuration.

Default: No validators.

versionLabeloptionalstringversion_labeloptionalstrversionLabeloptionalStringVersionLabeloptionalstringVersionLabeloptional*string= None.#
The version label of the hosted configuration.

Properties ​

applicationIApplicationapplicationIApplicationapplicationIApplicationApplicationIApplicationApplicationIApplicationrequired#
The application associated with the configuration.
configurationProfileArnstringconfiguration_profile_arnstrconfigurationProfileArnStringConfigurationProfileArnstringConfigurationProfileArn*stringrequired#
The Amazon Resource Name (ARN) of the configuration profile.
configurationProfileIdstringconfiguration_profile_idstrconfigurationProfileIdStringConfigurationProfileIdstringConfigurationProfileId*stringrequired#
The ID of the configuration profile.
contentstringcontentstrcontentStringContentstringContent*stringrequired#
The content of the hosted configuration.
contentTypemay be undefinedstringcontent_typemay be undefinedstrcontentTypemay be undefinedStringContentTypemay be undefinedstringContentTypemay be undefined*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

deploymentKeymay be undefinedIKeydeployment_keymay be undefinedIKeydeploymentKeymay be undefinedIKeyDeploymentKeymay be undefinedIKeyDeploymentKeymay be undefinedIKey#
The deployment key for the configuration.
deploymentStrategymay be undefinedIDeploymentStrategydeployment_strategymay be undefinedIDeploymentStrategydeploymentStrategymay be undefinedIDeploymentStrategyDeploymentStrategymay be undefinedIDeploymentStrategyDeploymentStrategymay be undefinedIDeploymentStrategy#
The deployment strategy for the configuration.
deployTomay be undefinedIEnvironment[]deploy_tomay be undefinedtyping.List[IEnvironment]deployTomay be undefinedList<IEnvironment>DeployTomay be undefinedIEnvironment[]DeployTomay be undefined*[]IEnvironment#
The environments to deploy to.
descriptionmay be undefinedstringdescriptionmay be undefinedstrdescriptionmay be undefinedStringDescriptionmay be undefinedstringDescriptionmay be undefined*string#
The description of the configuration.
hostedConfigurationVersionArnstringhosted_configuration_version_arnstrhostedConfigurationVersionArnStringHostedConfigurationVersionArnstringHostedConfigurationVersionArn*stringrequired#
The Amazon Resource Name (ARN) of the hosted configuration version.
latestVersionNumbermay be undefinednumberlatest_version_numbermay be undefinedint | floatlatestVersionNumbermay be undefinedNumberLatestVersionNumbermay be undefineddoubleLatestVersionNumbermay be undefined*float64#
The latest version number of the hosted configuration.
namemay be undefinedstringnamemay be undefinedstrnamemay be undefinedStringNamemay be undefinedstringNamemay be undefined*string#
The name of the configuration.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
typemay be undefinedConfigurationTypetypemay be undefinedConfigurationTypetypemay be undefinedConfigurationTypeTypemay be undefinedConfigurationTypeTypemay be undefinedConfigurationType#
The configuration type.
validatorsmay be undefinedIValidator[]validatorsmay be undefinedtyping.List[IValidator]validatorsmay be undefinedList<IValidator>Validatorsmay be undefinedIValidator[]Validatorsmay be undefined*[]IValidator#
The validators for the configuration.
versionLabelmay be undefinedstringversion_labelmay be undefinedstrversionLabelmay be undefinedStringVersionLabelmay be undefinedstringVersionLabelmay be undefined*string#
The version label of the hosted configuration.
versionNumbermay be undefinedstringversion_numbermay be undefinedstrversionNumbermay be undefinedStringVersionNumbermay be undefinedstringVersionNumbermay be undefined*string#
The version number of the hosted configuration.

Methods ​

addExtension(extension: IExtension): voiddef add_extension(self, extension: IExtension) -> Nonepublic void addExtension(IExtension extension)public void AddExtension(IExtension extension)func AddExtension(Extension IExtension)#
Adds an extension association to the configuration profile.
1 parameter

Parameters

  • extensionextensionextensionextensionExtension — The extension to create an association for.
atDeploymentTick(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef at_deployment_tick(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void atDeploymentTick(IEventDestination eventDestination, ExtensionOptions options)public void AtDeploymentTick(IEventDestination eventDestination, ExtensionOptions? options = null)func AtDeploymentTick(EventDestination IEventDestination, Options ExtensionOptions)#
Adds an AT_DEPLOYMENT_TICK extension with the provided event destination and also creates an extension association to an application.
2 parameters

Parameters

  • eventDestinationevent_destinationeventDestinationeventDestinationEventDestination — The event that occurs during the extension.
  • optionsoptionsoptionsoptionsOptions — Options for the extension.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

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

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

Parameters

  • xxxxX — Any object.

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

on(actionPoint: ActionPoint, eventDestination: IEventDestination, options?: ExtensionOptions): voiddef on(self, action_point: ActionPoint, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void on(ActionPoint actionPoint, IEventDestination eventDestination, ExtensionOptions options)public void On(ActionPoint actionPoint, IEventDestination eventDestination, ExtensionOptions? options = null)func On(ActionPoint ActionPoint, EventDestination IEventDestination, Options ExtensionOptions)#
Adds an extension defined by the action point and event destination and also creates an extension association to the configuration profile.
3 parameters

Parameters

  • actionPointaction_pointactionPointactionPointActionPoint — The action point which triggers the event.
  • eventDestinationevent_destinationeventDestinationeventDestinationEventDestination — The event that occurs during the extension.
  • optionsoptionsoptionsoptionsOptions — Options for the extension.
onDeploymentBaking(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef on_deployment_baking(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void onDeploymentBaking(IEventDestination eventDestination, ExtensionOptions options)public void OnDeploymentBaking(IEventDestination eventDestination, ExtensionOptions? options = null)func OnDeploymentBaking(EventDestination IEventDestination, Options ExtensionOptions)#
Adds an ON_DEPLOYMENT_BAKING extension with the provided event destination and also creates an extension association to the configuration profile.
2 parameters

Parameters

  • eventDestinationevent_destinationeventDestinationeventDestinationEventDestination — The event that occurs during the extension.
  • optionsoptionsoptionsoptionsOptions — Options for the extension.
onDeploymentComplete(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef on_deployment_complete(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void onDeploymentComplete(IEventDestination eventDestination, ExtensionOptions options)public void OnDeploymentComplete(IEventDestination eventDestination, ExtensionOptions? options = null)func OnDeploymentComplete(EventDestination IEventDestination, Options ExtensionOptions)#
Adds an ON_DEPLOYMENT_COMPLETE extension with the provided event destination and also creates an extension association to the configuration profile.
2 parameters

Parameters

  • eventDestinationevent_destinationeventDestinationeventDestinationEventDestination — The event that occurs during the extension.
  • optionsoptionsoptionsoptionsOptions — Options for the extension.
onDeploymentRolledBack(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef on_deployment_rolled_back(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void onDeploymentRolledBack(IEventDestination eventDestination, ExtensionOptions options)public void OnDeploymentRolledBack(IEventDestination eventDestination, ExtensionOptions? options = null)func OnDeploymentRolledBack(EventDestination IEventDestination, Options ExtensionOptions)#
Adds an ON_DEPLOYMENT_ROLLED_BACK extension with the provided event destination and also creates an extension association to the configuration profile.
2 parameters

Parameters

  • eventDestinationevent_destinationeventDestinationeventDestinationEventDestination — The event that occurs during the extension.
  • optionsoptionsoptionsoptionsOptions — Options for the extension.
onDeploymentStart(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef on_deployment_start(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void onDeploymentStart(IEventDestination eventDestination, ExtensionOptions options)public void OnDeploymentStart(IEventDestination eventDestination, ExtensionOptions? options = null)func OnDeploymentStart(EventDestination IEventDestination, Options ExtensionOptions)#
Adds an ON_DEPLOYMENT_START extension with the provided event destination and also creates an extension association to the configuration profile.
2 parameters

Parameters

  • eventDestinationevent_destinationeventDestinationeventDestinationEventDestination — The event that occurs during the extension.
  • optionsoptionsoptionsoptionsOptions — Options for the extension.
onDeploymentStep(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef on_deployment_step(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void onDeploymentStep(IEventDestination eventDestination, ExtensionOptions options)public void OnDeploymentStep(IEventDestination eventDestination, ExtensionOptions? options = null)func OnDeploymentStep(EventDestination IEventDestination, Options ExtensionOptions)#
Adds an ON_DEPLOYMENT_STEP extension with the provided event destination and also creates an extension association to the configuration profile.
2 parameters

Parameters

  • eventDestinationevent_destinationeventDestinationeventDestinationEventDestination — The event that occurs during the extension.
  • optionsoptionsoptionsoptionsOptions — Options for the extension.
preCreateHostedConfigurationVersion(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef pre_create_hosted_configuration_version(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void preCreateHostedConfigurationVersion(IEventDestination eventDestination, ExtensionOptions options)public void PreCreateHostedConfigurationVersion(IEventDestination eventDestination, ExtensionOptions? options = null)func PreCreateHostedConfigurationVersion(EventDestination IEventDestination, Options ExtensionOptions)#
Adds a PRE_CREATE_HOSTED_CONFIGURATION_VERSION extension with the provided event destination and also creates an extension association to the configuration profile.
2 parameters

Parameters

  • eventDestinationevent_destinationeventDestinationeventDestinationEventDestination — The event that occurs during the extension.
  • optionsoptionsoptionsoptionsOptions — Options for the extension.
preStartDeployment(eventDestination: IEventDestination, options?: ExtensionOptions): voiddef pre_start_deployment(self, event_destination: IEventDestination, options: typing.Optional[ExtensionOptions] = None) -> Nonepublic void preStartDeployment(IEventDestination eventDestination, ExtensionOptions options)public void PreStartDeployment(IEventDestination eventDestination, ExtensionOptions? options = null)func PreStartDeployment(EventDestination IEventDestination, Options ExtensionOptions)#
Adds a PRE_START_DEPLOYMENT extension with the provided event destination and also creates an extension association to the configuration profile.
2 parameters

Parameters

  • eventDestinationevent_destinationeventDestinationeventDestinationEventDestination — The event that occurs during the extension.
  • optionsoptionsoptionsoptionsOptions — Options for the extension.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

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

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining