@aws-cdk/aws-cloudformation
Version:
The CDK Construct Library for AWS::CloudFormation
1,040 lines (1,039 loc) • 588 kB
JavaScript
"use strict";
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CfnWaitConditionHandle = exports.CfnWaitCondition = exports.CfnTypeActivation = exports.CfnStackSet = exports.CfnStack = exports.CfnResourceVersion = exports.CfnResourceDefaultVersion = exports.CfnPublisher = exports.CfnPublicTypeVersion = exports.CfnModuleVersion = exports.CfnModuleDefaultVersion = exports.CfnMacro = exports.CfnHookVersion = exports.CfnHookTypeConfig = exports.CfnHookDefaultVersion = exports.CfnCustomResource = void 0;
const jsiiDeprecationWarnings = require("../.warnings.jsii.js");
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
// Copyright 2012-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// Generated from the AWS CloudFormation Resource Specification
// See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html
// @cfn2ts:meta@ {"generated":"2023-05-31T17:25:11.621Z","fingerprint":"JU8SjLSkxP+ftWwbwbS0X5JC1OrJnrTdRYdD3Uf2ocs="}
/* eslint-disable max-len */ // This is generated code - line lengths are difficult to control
const cdk = require("@aws-cdk/core");
const cfn_parse = require("@aws-cdk/core/lib/helpers-internal");
/**
* Determine whether the given properties match those of a `CfnCustomResourceProps`
*
* @param properties - the TypeScript properties of a `CfnCustomResourceProps`
*
* @returns the result of the validation.
*/
function CfnCustomResourcePropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));
}
errors.collect(cdk.propertyValidator('serviceToken', cdk.requiredValidator)(properties.serviceToken));
errors.collect(cdk.propertyValidator('serviceToken', cdk.validateString)(properties.serviceToken));
return errors.wrap('supplied properties not correct for "CfnCustomResourceProps"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::CloudFormation::CustomResource` resource
*
* @param properties - the TypeScript properties of a `CfnCustomResourceProps`
*
* @returns the AWS CloudFormation properties of an `AWS::CloudFormation::CustomResource` resource.
*/
// @ts-ignore TS6133
function cfnCustomResourcePropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnCustomResourcePropsValidator(properties).assertSuccess();
return {
ServiceToken: cdk.stringToCloudFormation(properties.serviceToken),
};
}
// @ts-ignore TS6133
function CfnCustomResourcePropsFromCloudFormation(properties) {
properties = properties == null ? {} : properties;
if (typeof properties !== 'object') {
return new cfn_parse.FromCloudFormationResult(properties);
}
const ret = new cfn_parse.FromCloudFormationPropertyObject();
ret.addPropertyResult('serviceToken', 'ServiceToken', cfn_parse.FromCloudFormation.getString(properties.ServiceToken));
ret.addUnrecognizedPropertiesAsExtra(properties);
return ret;
}
/**
* A CloudFormation `AWS::CloudFormation::CustomResource`
*
* In a CloudFormation template, you use the `AWS::CloudFormation::CustomResource` or `Custom:: *String*` resource type to specify custom resources.
*
* Custom resources provide a way for you to write custom provisioning logic in CloudFormation template and have CloudFormation run it during a stack operation, such as when you create, update or delete a stack. For more information, see [Custom resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html) .
*
* > If you use the [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html) feature, custom resources in the VPC must have access to CloudFormation -specific Amazon Simple Storage Service ( Amazon S3 ) buckets. Custom resources must send responses to a presigned Amazon S3 URL. If they can't send responses to Amazon S3 , CloudFormation won't receive a response and the stack operation fails. For more information, see [Setting up VPC endpoints for AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-vpce-bucketnames.html) .
*
* @cloudformationResource AWS::CloudFormation::CustomResource
* @stability external
*
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html
*/
class CfnCustomResource extends cdk.CfnResource {
/**
* Create a new `AWS::CloudFormation::CustomResource`.
*
* @param scope - scope in which this resource is defined
* @param id - scoped id of the resource
* @param props - resource properties
*/
constructor(scope, id, props) {
super(scope, id, { type: CfnCustomResource.CFN_RESOURCE_TYPE_NAME, properties: props });
try {
jsiiDeprecationWarnings._aws_cdk_aws_cloudformation_CfnCustomResourceProps(props);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, CfnCustomResource);
}
throw error;
}
cdk.requireProperty(props, 'serviceToken', this);
this.serviceToken = props.serviceToken;
}
/**
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @internal
*/
static _fromCloudFormation(scope, id, resourceAttributes, options) {
resourceAttributes = resourceAttributes || {};
const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);
const propsResult = CfnCustomResourcePropsFromCloudFormation(resourceProperties);
const ret = new CfnCustomResource(scope, id, propsResult.value);
for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {
ret.addPropertyOverride(propKey, propVal);
}
options.parser.handleAttributes(ret, resourceAttributes, id);
return ret;
}
/**
* Examines the CloudFormation resource and discloses attributes.
*
* @param inspector - tree inspector to collect and process attributes
*
*/
inspect(inspector) {
inspector.addAttribute("aws:cdk:cloudformation:type", CfnCustomResource.CFN_RESOURCE_TYPE_NAME);
inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties);
}
get cfnProperties() {
return {
serviceToken: this.serviceToken,
};
}
renderProperties(props) {
return cfnCustomResourcePropsToCloudFormation(props);
}
}
exports.CfnCustomResource = CfnCustomResource;
_a = JSII_RTTI_SYMBOL_1;
CfnCustomResource[_a] = { fqn: "@aws-cdk/aws-cloudformation.CfnCustomResource", version: "1.203.0" };
/**
* The CloudFormation resource type name for this resource class.
*/
CfnCustomResource.CFN_RESOURCE_TYPE_NAME = "AWS::CloudFormation::CustomResource";
/**
* Determine whether the given properties match those of a `CfnHookDefaultVersionProps`
*
* @param properties - the TypeScript properties of a `CfnHookDefaultVersionProps`
*
* @returns the result of the validation.
*/
function CfnHookDefaultVersionPropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));
}
errors.collect(cdk.propertyValidator('typeName', cdk.validateString)(properties.typeName));
errors.collect(cdk.propertyValidator('typeVersionArn', cdk.validateString)(properties.typeVersionArn));
errors.collect(cdk.propertyValidator('versionId', cdk.validateString)(properties.versionId));
return errors.wrap('supplied properties not correct for "CfnHookDefaultVersionProps"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::CloudFormation::HookDefaultVersion` resource
*
* @param properties - the TypeScript properties of a `CfnHookDefaultVersionProps`
*
* @returns the AWS CloudFormation properties of an `AWS::CloudFormation::HookDefaultVersion` resource.
*/
// @ts-ignore TS6133
function cfnHookDefaultVersionPropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnHookDefaultVersionPropsValidator(properties).assertSuccess();
return {
TypeName: cdk.stringToCloudFormation(properties.typeName),
TypeVersionArn: cdk.stringToCloudFormation(properties.typeVersionArn),
VersionId: cdk.stringToCloudFormation(properties.versionId),
};
}
// @ts-ignore TS6133
function CfnHookDefaultVersionPropsFromCloudFormation(properties) {
properties = properties == null ? {} : properties;
if (typeof properties !== 'object') {
return new cfn_parse.FromCloudFormationResult(properties);
}
const ret = new cfn_parse.FromCloudFormationPropertyObject();
ret.addPropertyResult('typeName', 'TypeName', properties.TypeName != null ? cfn_parse.FromCloudFormation.getString(properties.TypeName) : undefined);
ret.addPropertyResult('typeVersionArn', 'TypeVersionArn', properties.TypeVersionArn != null ? cfn_parse.FromCloudFormation.getString(properties.TypeVersionArn) : undefined);
ret.addPropertyResult('versionId', 'VersionId', properties.VersionId != null ? cfn_parse.FromCloudFormation.getString(properties.VersionId) : undefined);
ret.addUnrecognizedPropertiesAsExtra(properties);
return ret;
}
/**
* A CloudFormation `AWS::CloudFormation::HookDefaultVersion`
*
* The `HookDefaultVersion` resource specifies the default version of the hook. The default version of the hook is used in CloudFormation operations for this AWS account and AWS Region .
*
* @cloudformationResource AWS::CloudFormation::HookDefaultVersion
* @stability external
*
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookdefaultversion.html
*/
class CfnHookDefaultVersion extends cdk.CfnResource {
/**
* Create a new `AWS::CloudFormation::HookDefaultVersion`.
*
* @param scope - scope in which this resource is defined
* @param id - scoped id of the resource
* @param props - resource properties
*/
constructor(scope, id, props = {}) {
super(scope, id, { type: CfnHookDefaultVersion.CFN_RESOURCE_TYPE_NAME, properties: props });
try {
jsiiDeprecationWarnings._aws_cdk_aws_cloudformation_CfnHookDefaultVersionProps(props);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, CfnHookDefaultVersion);
}
throw error;
}
this.attrArn = cdk.Token.asString(this.getAtt('Arn'));
this.typeName = props.typeName;
this.typeVersionArn = props.typeVersionArn;
this.versionId = props.versionId;
}
/**
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @internal
*/
static _fromCloudFormation(scope, id, resourceAttributes, options) {
resourceAttributes = resourceAttributes || {};
const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);
const propsResult = CfnHookDefaultVersionPropsFromCloudFormation(resourceProperties);
const ret = new CfnHookDefaultVersion(scope, id, propsResult.value);
for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {
ret.addPropertyOverride(propKey, propVal);
}
options.parser.handleAttributes(ret, resourceAttributes, id);
return ret;
}
/**
* Examines the CloudFormation resource and discloses attributes.
*
* @param inspector - tree inspector to collect and process attributes
*
*/
inspect(inspector) {
inspector.addAttribute("aws:cdk:cloudformation:type", CfnHookDefaultVersion.CFN_RESOURCE_TYPE_NAME);
inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties);
}
get cfnProperties() {
return {
typeName: this.typeName,
typeVersionArn: this.typeVersionArn,
versionId: this.versionId,
};
}
renderProperties(props) {
return cfnHookDefaultVersionPropsToCloudFormation(props);
}
}
exports.CfnHookDefaultVersion = CfnHookDefaultVersion;
_b = JSII_RTTI_SYMBOL_1;
CfnHookDefaultVersion[_b] = { fqn: "@aws-cdk/aws-cloudformation.CfnHookDefaultVersion", version: "1.203.0" };
/**
* The CloudFormation resource type name for this resource class.
*/
CfnHookDefaultVersion.CFN_RESOURCE_TYPE_NAME = "AWS::CloudFormation::HookDefaultVersion";
/**
* Determine whether the given properties match those of a `CfnHookTypeConfigProps`
*
* @param properties - the TypeScript properties of a `CfnHookTypeConfigProps`
*
* @returns the result of the validation.
*/
function CfnHookTypeConfigPropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));
}
errors.collect(cdk.propertyValidator('configuration', cdk.requiredValidator)(properties.configuration));
errors.collect(cdk.propertyValidator('configuration', cdk.validateString)(properties.configuration));
errors.collect(cdk.propertyValidator('configurationAlias', cdk.validateString)(properties.configurationAlias));
errors.collect(cdk.propertyValidator('typeArn', cdk.validateString)(properties.typeArn));
errors.collect(cdk.propertyValidator('typeName', cdk.validateString)(properties.typeName));
return errors.wrap('supplied properties not correct for "CfnHookTypeConfigProps"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::CloudFormation::HookTypeConfig` resource
*
* @param properties - the TypeScript properties of a `CfnHookTypeConfigProps`
*
* @returns the AWS CloudFormation properties of an `AWS::CloudFormation::HookTypeConfig` resource.
*/
// @ts-ignore TS6133
function cfnHookTypeConfigPropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnHookTypeConfigPropsValidator(properties).assertSuccess();
return {
Configuration: cdk.stringToCloudFormation(properties.configuration),
ConfigurationAlias: cdk.stringToCloudFormation(properties.configurationAlias),
TypeArn: cdk.stringToCloudFormation(properties.typeArn),
TypeName: cdk.stringToCloudFormation(properties.typeName),
};
}
// @ts-ignore TS6133
function CfnHookTypeConfigPropsFromCloudFormation(properties) {
properties = properties == null ? {} : properties;
if (typeof properties !== 'object') {
return new cfn_parse.FromCloudFormationResult(properties);
}
const ret = new cfn_parse.FromCloudFormationPropertyObject();
ret.addPropertyResult('configuration', 'Configuration', cfn_parse.FromCloudFormation.getString(properties.Configuration));
ret.addPropertyResult('configurationAlias', 'ConfigurationAlias', properties.ConfigurationAlias != null ? cfn_parse.FromCloudFormation.getString(properties.ConfigurationAlias) : undefined);
ret.addPropertyResult('typeArn', 'TypeArn', properties.TypeArn != null ? cfn_parse.FromCloudFormation.getString(properties.TypeArn) : undefined);
ret.addPropertyResult('typeName', 'TypeName', properties.TypeName != null ? cfn_parse.FromCloudFormation.getString(properties.TypeName) : undefined);
ret.addUnrecognizedPropertiesAsExtra(properties);
return ret;
}
/**
* A CloudFormation `AWS::CloudFormation::HookTypeConfig`
*
* The `HookTypeConfig` resource specifies the configuration of a hook.
*
* @cloudformationResource AWS::CloudFormation::HookTypeConfig
* @stability external
*
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hooktypeconfig.html
*/
class CfnHookTypeConfig extends cdk.CfnResource {
/**
* Create a new `AWS::CloudFormation::HookTypeConfig`.
*
* @param scope - scope in which this resource is defined
* @param id - scoped id of the resource
* @param props - resource properties
*/
constructor(scope, id, props) {
super(scope, id, { type: CfnHookTypeConfig.CFN_RESOURCE_TYPE_NAME, properties: props });
try {
jsiiDeprecationWarnings._aws_cdk_aws_cloudformation_CfnHookTypeConfigProps(props);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, CfnHookTypeConfig);
}
throw error;
}
cdk.requireProperty(props, 'configuration', this);
this.attrConfigurationArn = cdk.Token.asString(this.getAtt('ConfigurationArn'));
this.configuration = props.configuration;
this.configurationAlias = props.configurationAlias;
this.typeArn = props.typeArn;
this.typeName = props.typeName;
}
/**
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @internal
*/
static _fromCloudFormation(scope, id, resourceAttributes, options) {
resourceAttributes = resourceAttributes || {};
const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);
const propsResult = CfnHookTypeConfigPropsFromCloudFormation(resourceProperties);
const ret = new CfnHookTypeConfig(scope, id, propsResult.value);
for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {
ret.addPropertyOverride(propKey, propVal);
}
options.parser.handleAttributes(ret, resourceAttributes, id);
return ret;
}
/**
* Examines the CloudFormation resource and discloses attributes.
*
* @param inspector - tree inspector to collect and process attributes
*
*/
inspect(inspector) {
inspector.addAttribute("aws:cdk:cloudformation:type", CfnHookTypeConfig.CFN_RESOURCE_TYPE_NAME);
inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties);
}
get cfnProperties() {
return {
configuration: this.configuration,
configurationAlias: this.configurationAlias,
typeArn: this.typeArn,
typeName: this.typeName,
};
}
renderProperties(props) {
return cfnHookTypeConfigPropsToCloudFormation(props);
}
}
exports.CfnHookTypeConfig = CfnHookTypeConfig;
_c = JSII_RTTI_SYMBOL_1;
CfnHookTypeConfig[_c] = { fqn: "@aws-cdk/aws-cloudformation.CfnHookTypeConfig", version: "1.203.0" };
/**
* The CloudFormation resource type name for this resource class.
*/
CfnHookTypeConfig.CFN_RESOURCE_TYPE_NAME = "AWS::CloudFormation::HookTypeConfig";
/**
* Determine whether the given properties match those of a `CfnHookVersionProps`
*
* @param properties - the TypeScript properties of a `CfnHookVersionProps`
*
* @returns the result of the validation.
*/
function CfnHookVersionPropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));
}
errors.collect(cdk.propertyValidator('executionRoleArn', cdk.validateString)(properties.executionRoleArn));
errors.collect(cdk.propertyValidator('loggingConfig', CfnHookVersion_LoggingConfigPropertyValidator)(properties.loggingConfig));
errors.collect(cdk.propertyValidator('schemaHandlerPackage', cdk.requiredValidator)(properties.schemaHandlerPackage));
errors.collect(cdk.propertyValidator('schemaHandlerPackage', cdk.validateString)(properties.schemaHandlerPackage));
errors.collect(cdk.propertyValidator('typeName', cdk.requiredValidator)(properties.typeName));
errors.collect(cdk.propertyValidator('typeName', cdk.validateString)(properties.typeName));
return errors.wrap('supplied properties not correct for "CfnHookVersionProps"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::CloudFormation::HookVersion` resource
*
* @param properties - the TypeScript properties of a `CfnHookVersionProps`
*
* @returns the AWS CloudFormation properties of an `AWS::CloudFormation::HookVersion` resource.
*/
// @ts-ignore TS6133
function cfnHookVersionPropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnHookVersionPropsValidator(properties).assertSuccess();
return {
SchemaHandlerPackage: cdk.stringToCloudFormation(properties.schemaHandlerPackage),
TypeName: cdk.stringToCloudFormation(properties.typeName),
ExecutionRoleArn: cdk.stringToCloudFormation(properties.executionRoleArn),
LoggingConfig: cfnHookVersionLoggingConfigPropertyToCloudFormation(properties.loggingConfig),
};
}
// @ts-ignore TS6133
function CfnHookVersionPropsFromCloudFormation(properties) {
properties = properties == null ? {} : properties;
if (typeof properties !== 'object') {
return new cfn_parse.FromCloudFormationResult(properties);
}
const ret = new cfn_parse.FromCloudFormationPropertyObject();
ret.addPropertyResult('schemaHandlerPackage', 'SchemaHandlerPackage', cfn_parse.FromCloudFormation.getString(properties.SchemaHandlerPackage));
ret.addPropertyResult('typeName', 'TypeName', cfn_parse.FromCloudFormation.getString(properties.TypeName));
ret.addPropertyResult('executionRoleArn', 'ExecutionRoleArn', properties.ExecutionRoleArn != null ? cfn_parse.FromCloudFormation.getString(properties.ExecutionRoleArn) : undefined);
ret.addPropertyResult('loggingConfig', 'LoggingConfig', properties.LoggingConfig != null ? CfnHookVersionLoggingConfigPropertyFromCloudFormation(properties.LoggingConfig) : undefined);
ret.addUnrecognizedPropertiesAsExtra(properties);
return ret;
}
/**
* A CloudFormation `AWS::CloudFormation::HookVersion`
*
* The `HookVersion` resource publishes new or first hook version to the AWS CloudFormation registry.
*
* @cloudformationResource AWS::CloudFormation::HookVersion
* @stability external
*
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookversion.html
*/
class CfnHookVersion extends cdk.CfnResource {
/**
* Create a new `AWS::CloudFormation::HookVersion`.
*
* @param scope - scope in which this resource is defined
* @param id - scoped id of the resource
* @param props - resource properties
*/
constructor(scope, id, props) {
super(scope, id, { type: CfnHookVersion.CFN_RESOURCE_TYPE_NAME, properties: props });
try {
jsiiDeprecationWarnings._aws_cdk_aws_cloudformation_CfnHookVersionProps(props);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, CfnHookVersion);
}
throw error;
}
cdk.requireProperty(props, 'schemaHandlerPackage', this);
cdk.requireProperty(props, 'typeName', this);
this.attrArn = cdk.Token.asString(this.getAtt('Arn'));
this.attrIsDefaultVersion = this.getAtt('IsDefaultVersion');
this.attrTypeArn = cdk.Token.asString(this.getAtt('TypeArn'));
this.attrVersionId = cdk.Token.asString(this.getAtt('VersionId'));
this.attrVisibility = cdk.Token.asString(this.getAtt('Visibility'));
this.schemaHandlerPackage = props.schemaHandlerPackage;
this.typeName = props.typeName;
this.executionRoleArn = props.executionRoleArn;
this.loggingConfig = props.loggingConfig;
}
/**
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @internal
*/
static _fromCloudFormation(scope, id, resourceAttributes, options) {
resourceAttributes = resourceAttributes || {};
const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);
const propsResult = CfnHookVersionPropsFromCloudFormation(resourceProperties);
const ret = new CfnHookVersion(scope, id, propsResult.value);
for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {
ret.addPropertyOverride(propKey, propVal);
}
options.parser.handleAttributes(ret, resourceAttributes, id);
return ret;
}
/**
* Examines the CloudFormation resource and discloses attributes.
*
* @param inspector - tree inspector to collect and process attributes
*
*/
inspect(inspector) {
inspector.addAttribute("aws:cdk:cloudformation:type", CfnHookVersion.CFN_RESOURCE_TYPE_NAME);
inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties);
}
get cfnProperties() {
return {
schemaHandlerPackage: this.schemaHandlerPackage,
typeName: this.typeName,
executionRoleArn: this.executionRoleArn,
loggingConfig: this.loggingConfig,
};
}
renderProperties(props) {
return cfnHookVersionPropsToCloudFormation(props);
}
}
exports.CfnHookVersion = CfnHookVersion;
_d = JSII_RTTI_SYMBOL_1;
CfnHookVersion[_d] = { fqn: "@aws-cdk/aws-cloudformation.CfnHookVersion", version: "1.203.0" };
/**
* The CloudFormation resource type name for this resource class.
*/
CfnHookVersion.CFN_RESOURCE_TYPE_NAME = "AWS::CloudFormation::HookVersion";
/**
* Determine whether the given properties match those of a `LoggingConfigProperty`
*
* @param properties - the TypeScript properties of a `LoggingConfigProperty`
*
* @returns the result of the validation.
*/
function CfnHookVersion_LoggingConfigPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));
}
errors.collect(cdk.propertyValidator('logGroupName', cdk.validateString)(properties.logGroupName));
errors.collect(cdk.propertyValidator('logRoleArn', cdk.validateString)(properties.logRoleArn));
return errors.wrap('supplied properties not correct for "LoggingConfigProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::CloudFormation::HookVersion.LoggingConfig` resource
*
* @param properties - the TypeScript properties of a `LoggingConfigProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::CloudFormation::HookVersion.LoggingConfig` resource.
*/
// @ts-ignore TS6133
function cfnHookVersionLoggingConfigPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnHookVersion_LoggingConfigPropertyValidator(properties).assertSuccess();
return {
LogGroupName: cdk.stringToCloudFormation(properties.logGroupName),
LogRoleArn: cdk.stringToCloudFormation(properties.logRoleArn),
};
}
// @ts-ignore TS6133
function CfnHookVersionLoggingConfigPropertyFromCloudFormation(properties) {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties == null ? {} : properties;
if (typeof properties !== 'object') {
return new cfn_parse.FromCloudFormationResult(properties);
}
const ret = new cfn_parse.FromCloudFormationPropertyObject();
ret.addPropertyResult('logGroupName', 'LogGroupName', properties.LogGroupName != null ? cfn_parse.FromCloudFormation.getString(properties.LogGroupName) : undefined);
ret.addPropertyResult('logRoleArn', 'LogRoleArn', properties.LogRoleArn != null ? cfn_parse.FromCloudFormation.getString(properties.LogRoleArn) : undefined);
ret.addUnrecognizedPropertiesAsExtra(properties);
return ret;
}
/**
* Determine whether the given properties match those of a `CfnMacroProps`
*
* @param properties - the TypeScript properties of a `CfnMacroProps`
*
* @returns the result of the validation.
*/
function CfnMacroPropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));
}
errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description));
errors.collect(cdk.propertyValidator('functionName', cdk.requiredValidator)(properties.functionName));
errors.collect(cdk.propertyValidator('functionName', cdk.validateString)(properties.functionName));
errors.collect(cdk.propertyValidator('logGroupName', cdk.validateString)(properties.logGroupName));
errors.collect(cdk.propertyValidator('logRoleArn', cdk.validateString)(properties.logRoleArn));
errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name));
errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));
return errors.wrap('supplied properties not correct for "CfnMacroProps"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::CloudFormation::Macro` resource
*
* @param properties - the TypeScript properties of a `CfnMacroProps`
*
* @returns the AWS CloudFormation properties of an `AWS::CloudFormation::Macro` resource.
*/
// @ts-ignore TS6133
function cfnMacroPropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnMacroPropsValidator(properties).assertSuccess();
return {
FunctionName: cdk.stringToCloudFormation(properties.functionName),
Name: cdk.stringToCloudFormation(properties.name),
Description: cdk.stringToCloudFormation(properties.description),
LogGroupName: cdk.stringToCloudFormation(properties.logGroupName),
LogRoleARN: cdk.stringToCloudFormation(properties.logRoleArn),
};
}
// @ts-ignore TS6133
function CfnMacroPropsFromCloudFormation(properties) {
properties = properties == null ? {} : properties;
if (typeof properties !== 'object') {
return new cfn_parse.FromCloudFormationResult(properties);
}
const ret = new cfn_parse.FromCloudFormationPropertyObject();
ret.addPropertyResult('functionName', 'FunctionName', cfn_parse.FromCloudFormation.getString(properties.FunctionName));
ret.addPropertyResult('name', 'Name', cfn_parse.FromCloudFormation.getString(properties.Name));
ret.addPropertyResult('description', 'Description', properties.Description != null ? cfn_parse.FromCloudFormation.getString(properties.Description) : undefined);
ret.addPropertyResult('logGroupName', 'LogGroupName', properties.LogGroupName != null ? cfn_parse.FromCloudFormation.getString(properties.LogGroupName) : undefined);
ret.addPropertyResult('logRoleArn', 'LogRoleARN', properties.LogRoleARN != null ? cfn_parse.FromCloudFormation.getString(properties.LogRoleARN) : undefined);
ret.addUnrecognizedPropertiesAsExtra(properties);
return ret;
}
/**
* A CloudFormation `AWS::CloudFormation::Macro`
*
* The `AWS::CloudFormation::Macro` resource is a CloudFormation resource type that creates a CloudFormation macro to perform custom processing on CloudFormation templates. For more information, see [Using AWS CloudFormation macros to perform custom processing on templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html) .
*
* @cloudformationResource AWS::CloudFormation::Macro
* @stability external
*
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html
*/
class CfnMacro extends cdk.CfnResource {
/**
* Create a new `AWS::CloudFormation::Macro`.
*
* @param scope - scope in which this resource is defined
* @param id - scoped id of the resource
* @param props - resource properties
*/
constructor(scope, id, props) {
super(scope, id, { type: CfnMacro.CFN_RESOURCE_TYPE_NAME, properties: props });
try {
jsiiDeprecationWarnings._aws_cdk_aws_cloudformation_CfnMacroProps(props);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, CfnMacro);
}
throw error;
}
cdk.requireProperty(props, 'functionName', this);
cdk.requireProperty(props, 'name', this);
this.functionName = props.functionName;
this.name = props.name;
this.description = props.description;
this.logGroupName = props.logGroupName;
this.logRoleArn = props.logRoleArn;
}
/**
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @internal
*/
static _fromCloudFormation(scope, id, resourceAttributes, options) {
resourceAttributes = resourceAttributes || {};
const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);
const propsResult = CfnMacroPropsFromCloudFormation(resourceProperties);
const ret = new CfnMacro(scope, id, propsResult.value);
for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {
ret.addPropertyOverride(propKey, propVal);
}
options.parser.handleAttributes(ret, resourceAttributes, id);
return ret;
}
/**
* Examines the CloudFormation resource and discloses attributes.
*
* @param inspector - tree inspector to collect and process attributes
*
*/
inspect(inspector) {
inspector.addAttribute("aws:cdk:cloudformation:type", CfnMacro.CFN_RESOURCE_TYPE_NAME);
inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties);
}
get cfnProperties() {
return {
functionName: this.functionName,
name: this.name,
description: this.description,
logGroupName: this.logGroupName,
logRoleArn: this.logRoleArn,
};
}
renderProperties(props) {
return cfnMacroPropsToCloudFormation(props);
}
}
exports.CfnMacro = CfnMacro;
_e = JSII_RTTI_SYMBOL_1;
CfnMacro[_e] = { fqn: "@aws-cdk/aws-cloudformation.CfnMacro", version: "1.203.0" };
/**
* The CloudFormation resource type name for this resource class.
*/
CfnMacro.CFN_RESOURCE_TYPE_NAME = "AWS::CloudFormation::Macro";
/**
* Determine whether the given properties match those of a `CfnModuleDefaultVersionProps`
*
* @param properties - the TypeScript properties of a `CfnModuleDefaultVersionProps`
*
* @returns the result of the validation.
*/
function CfnModuleDefaultVersionPropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));
}
errors.collect(cdk.propertyValidator('arn', cdk.validateString)(properties.arn));
errors.collect(cdk.propertyValidator('moduleName', cdk.validateString)(properties.moduleName));
errors.collect(cdk.propertyValidator('versionId', cdk.validateString)(properties.versionId));
return errors.wrap('supplied properties not correct for "CfnModuleDefaultVersionProps"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::CloudFormation::ModuleDefaultVersion` resource
*
* @param properties - the TypeScript properties of a `CfnModuleDefaultVersionProps`
*
* @returns the AWS CloudFormation properties of an `AWS::CloudFormation::ModuleDefaultVersion` resource.
*/
// @ts-ignore TS6133
function cfnModuleDefaultVersionPropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnModuleDefaultVersionPropsValidator(properties).assertSuccess();
return {
Arn: cdk.stringToCloudFormation(properties.arn),
ModuleName: cdk.stringToCloudFormation(properties.moduleName),
VersionId: cdk.stringToCloudFormation(properties.versionId),
};
}
// @ts-ignore TS6133
function CfnModuleDefaultVersionPropsFromCloudFormation(properties) {
properties = properties == null ? {} : properties;
if (typeof properties !== 'object') {
return new cfn_parse.FromCloudFormationResult(properties);
}
const ret = new cfn_parse.FromCloudFormationPropertyObject();
ret.addPropertyResult('arn', 'Arn', properties.Arn != null ? cfn_parse.FromCloudFormation.getString(properties.Arn) : undefined);
ret.addPropertyResult('moduleName', 'ModuleName', properties.ModuleName != null ? cfn_parse.FromCloudFormation.getString(properties.ModuleName) : undefined);
ret.addPropertyResult('versionId', 'VersionId', properties.VersionId != null ? cfn_parse.FromCloudFormation.getString(properties.VersionId) : undefined);
ret.addUnrecognizedPropertiesAsExtra(properties);
return ret;
}
/**
* A CloudFormation `AWS::CloudFormation::ModuleDefaultVersion`
*
* Specifies the default version of a module. The default version of the module will be used in CloudFormation operations for this account and Region.
*
* To register a module version, use the `[AWS::CloudFormation::ModuleVersion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduleversion.html)` resource.
*
* For more information using modules, see [Using modules to encapsulate and reuse resource configurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/modules.html) and [Registering extensions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html#registry-register) in the *AWS CloudFormation User Guide* . For information on developing modules, see [Developing modules](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/modules.html) in the *AWS CloudFormation CLI User Guide* .
*
* @cloudformationResource AWS::CloudFormation::ModuleDefaultVersion
* @stability external
*
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduledefaultversion.html
*/
class CfnModuleDefaultVersion extends cdk.CfnResource {
/**
* Create a new `AWS::CloudFormation::ModuleDefaultVersion`.
*
* @param scope - scope in which this resource is defined
* @param id - scoped id of the resource
* @param props - resource properties
*/
constructor(scope, id, props = {}) {
super(scope, id, { type: CfnModuleDefaultVersion.CFN_RESOURCE_TYPE_NAME, properties: props });
try {
jsiiDeprecationWarnings._aws_cdk_aws_cloudformation_CfnModuleDefaultVersionProps(props);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, CfnModuleDefaultVersion);
}
throw error;
}
this.arn = props.arn;
this.moduleName = props.moduleName;
this.versionId = props.versionId;
}
/**
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @internal
*/
static _fromCloudFormation(scope, id, resourceAttributes, options) {
resourceAttributes = resourceAttributes || {};
const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);
const propsResult = CfnModuleDefaultVersionPropsFromCloudFormation(resourceProperties);
const ret = new CfnModuleDefaultVersion(scope, id, propsResult.value);
for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {
ret.addPropertyOverride(propKey, propVal);
}
options.parser.handleAttributes(ret, resourceAttributes, id);
return ret;
}
/**
* Examines the CloudFormation resource and discloses attributes.
*
* @param inspector - tree inspector to collect and process attributes
*
*/
inspect(inspector) {
inspector.addAttribute("aws:cdk:cloudformation:type", CfnModuleDefaultVersion.CFN_RESOURCE_TYPE_NAME);
inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties);
}
get cfnProperties() {
return {
arn: this.arn,
moduleName: this.moduleName,
versionId: this.versionId,
};
}
renderProperties(props) {
return cfnModuleDefaultVersionPropsToCloudFormation(props);
}
}
exports.CfnModuleDefaultVersion = CfnModuleDefaultVersion;
_f = JSII_RTTI_SYMBOL_1;
CfnModuleDefaultVersion[_f] = { fqn: "@aws-cdk/aws-cloudformation.CfnModuleDefaultVersion", version: "1.203.0" };
/**
* The CloudFormation resource type name for this resource class.
*/
CfnModuleDefaultVersion.CFN_RESOURCE_TYPE_NAME = "AWS::CloudFormation::ModuleDefaultVersion";
/**
* Determine whether the given properties match those of a `CfnModuleVersionProps`
*
* @param properties - the TypeScript properties of a `CfnModuleVersionProps`
*
* @returns the result of the validation.
*/
function CfnModuleVersionPropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));
}
errors.collect(cdk.propertyValidator('moduleName', cdk.requiredValidator)(properties.moduleName));
errors.collect(cdk.propertyValidator('moduleName', cdk.validateString)(properties.moduleName));
errors.collect(cdk.propertyValidator('modulePackage', cdk.requiredValidator)(properties.modulePackage));
errors.collect(cdk.propertyValidator('modulePackage', cdk.validateString)(properties.modulePackage));
return errors.wrap('supplied properties not correct for "CfnModuleVersionProps"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::CloudFormation::ModuleVersion` resource
*
* @param properties - the TypeScript properties of a `CfnModuleVersionProps`
*
* @returns the AWS CloudFormation properties of an `AWS::CloudFormation::ModuleVersion` resource.
*/
// @ts-ignore TS6133
function cfnModuleVersionPropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnModuleVersionPropsValidator(properties).assertSuccess();
return {
ModuleName: cdk.stringToCloudFormation(properties.moduleName),
ModulePackage: cdk.stringToCloudFormation(properties.modulePackage),
};
}
// @ts-ignore TS6133
function CfnModuleVersionPropsFromCloudFormation(properties) {
properties = properties == null ? {} : properties;
if (typeof properties !== 'object') {
return new cfn_parse.FromCloudFormationResult(properties);
}
const ret = new cfn_parse.FromCloudFormationPropertyObject();
ret.addPropertyResult('moduleName', 'ModuleName', cfn_parse.FromCloudFormation.getString(properties.ModuleName));
ret.addPropertyResult('modulePackage', 'ModulePackage', cfn_parse.FromCloudFormation.getString(properties.ModulePackage));
ret.addUnrecognizedPropertiesAsExtra(properties);
return ret;
}
/**
* A CloudFormation `AWS::CloudFormation::ModuleVersion`
*
* Registers the specified version of the module with the CloudFormation service. Registering a module makes it available for use in CloudFormation templates in your AWS account and Region.
*
* To specify a module version as the default version, use the `[AWS::CloudFormation::ModuleDefaultVersion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduledefaultversion.html)` resource.
*
* For more information using modules, see [Using modules to encapsulate and reuse resource configurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/modules.html) and [Registering extensions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html#registry-register) in the *CloudFormation User Guide* . For information on developing modules, see [Developing modules](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/modules.html) in the *CloudFormation CLI User Guide* .
*
* @cloudformationResource AWS::CloudFormation::ModuleVersion
* @stability external
*
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduleversion.html
*/
class CfnModuleVersion extends cdk.CfnResource {
/**
* Create a new `AWS::CloudFormation::ModuleVersion`.
*
* @param scope - scope in which this resource is defined
* @param id - scoped id of the resource
* @param props - resource properties
*/
constructor(scope, id, props) {
super(scope, id, { type: CfnModuleVersion.CFN_RESOURCE_TYPE_NAME, properties: props });
try {
jsiiDeprecationWarnings._aws_cdk_aws_cloudformation_CfnModuleVersionProps(props);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, CfnModuleVersion);
}
throw error;
}
cdk.requireProperty(props, 'moduleName', this);
cdk.requireProperty(props, 'modulePackage', this);
this.attrArn = cdk.Token.asString(this.getAtt('Arn'));
this.attrDescription = cdk.Token.asString(this.getAtt('Description'));
this.attrDocumentationUrl = cdk.Token.asString(this.getAtt('DocumentationUrl'));
this.attrIsDefaultVersion = this.getAtt('IsDefaultVersion');
this.attrSchema = cdk.Token.asString(this.getAtt('Schema'));
this.attrTimeCreated = cdk.Token.asString(this.getAtt('TimeCreated'));
this.attrVersionId = cdk.Token.asString(this.getAtt('VersionId'));
this.attrVisibility = cdk.Token.asString(this.getAtt('Visibility'));
this.moduleName = props.moduleName;
this.modulePackage = props.modulePackage;
}
/**
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @internal
*/
static _fromCloudFormation(scope, id, resourceAttributes, options) {
resourceAttributes = resourceAttributes || {};
const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);
const propsResult = CfnModuleVersionPropsFromCloudFormation(resourceProperties);
const ret = new CfnModuleVersion(scope, id, propsResult.value);
for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {
ret.addPropertyOverride(propKey, propVal);
}
options.parser.handleAttributes(ret, resourceAttributes, id);
return ret;
}
/**
* Examines the CloudFormation resource and discloses attributes.
*
* @param inspector - tree inspector to collect and process attributes
*
*/
inspect(inspector) {
inspector.addAttribute("aws:cdk:cloudformation:type", CfnModuleVersion.CFN_RESOURCE_TYPE_NAME);
inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties);
}
get cfnProperties() {
return {
moduleName: this.moduleName,
modulePackage: this.modulePackage,
};
}
renderProperties(props) {
return cfnModuleVersionPropsToCloudFormation(props);
}
}
exports.CfnModuleVersion = CfnModuleVersion;
_g = JSII_RTTI_SYMBOL_1;
CfnModuleVersion[_g] = { fqn: "@aws-cdk/aws-cloudformation.CfnModuleVersion", version: "1.203.0" };
/**
* The CloudFormation resource type name for this resource class.
*/
CfnModuleVersion.CFN_RESOURCE_TYPE_NAME = "AWS::CloudFormation::ModuleVersion";
/**
* Determine whether the given properties match those of a `CfnPublicTypeVersionProps`
*
* @param properties - the TypeScript properties of a `CfnPublicTypeVersionProps`
*
* @returns the result of the validation.
*/
function CfnPublicTypeVersionPropsValidator(properties) {
if (!cdk.canInspect(properties)) {