UNPKG

@cdktf/provider-aws

Version:

Prebuilt aws Provider for Terraform CDK (cdktf)

1,271 lines 180 kB
"use strict"; var _a, _b, _c, _d, _e, _f, _g, _h, _j; Object.defineProperty(exports, "__esModule", { value: true }); exports.SyntheticsCanary = exports.SyntheticsCanaryVpcConfigOutputReference = exports.SyntheticsCanaryScheduleOutputReference = exports.SyntheticsCanaryScheduleRetryConfigOutputReference = exports.SyntheticsCanaryRunConfigOutputReference = exports.SyntheticsCanaryArtifactConfigOutputReference = exports.SyntheticsCanaryArtifactConfigS3EncryptionOutputReference = exports.SyntheticsCanaryTimelineList = exports.SyntheticsCanaryTimelineOutputReference = void 0; exports.syntheticsCanaryTimelineToTerraform = syntheticsCanaryTimelineToTerraform; exports.syntheticsCanaryTimelineToHclTerraform = syntheticsCanaryTimelineToHclTerraform; exports.syntheticsCanaryArtifactConfigS3EncryptionToTerraform = syntheticsCanaryArtifactConfigS3EncryptionToTerraform; exports.syntheticsCanaryArtifactConfigS3EncryptionToHclTerraform = syntheticsCanaryArtifactConfigS3EncryptionToHclTerraform; exports.syntheticsCanaryArtifactConfigToTerraform = syntheticsCanaryArtifactConfigToTerraform; exports.syntheticsCanaryArtifactConfigToHclTerraform = syntheticsCanaryArtifactConfigToHclTerraform; exports.syntheticsCanaryRunConfigToTerraform = syntheticsCanaryRunConfigToTerraform; exports.syntheticsCanaryRunConfigToHclTerraform = syntheticsCanaryRunConfigToHclTerraform; exports.syntheticsCanaryScheduleRetryConfigToTerraform = syntheticsCanaryScheduleRetryConfigToTerraform; exports.syntheticsCanaryScheduleRetryConfigToHclTerraform = syntheticsCanaryScheduleRetryConfigToHclTerraform; exports.syntheticsCanaryScheduleToTerraform = syntheticsCanaryScheduleToTerraform; exports.syntheticsCanaryScheduleToHclTerraform = syntheticsCanaryScheduleToHclTerraform; exports.syntheticsCanaryVpcConfigToTerraform = syntheticsCanaryVpcConfigToTerraform; exports.syntheticsCanaryVpcConfigToHclTerraform = syntheticsCanaryVpcConfigToHclTerraform; const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti"); const cdktf = require("cdktf"); function syntheticsCanaryTimelineToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return {}; } function syntheticsCanaryTimelineToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = {}; return attrs; } class SyntheticsCanaryTimelineOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param complexObjectIndex the index of this item in the list * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource, terraformAttribute, complexObjectIndex, complexObjectIsFromSet) { super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); this.isEmptyObject = false; } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; } else { this.isEmptyObject = Object.keys(value).length === 0; } } // created - computed: true, optional: false, required: false get created() { return this.getStringAttribute('created'); } // last_modified - computed: true, optional: false, required: false get lastModified() { return this.getStringAttribute('last_modified'); } // last_started - computed: true, optional: false, required: false get lastStarted() { return this.getStringAttribute('last_started'); } // last_stopped - computed: true, optional: false, required: false get lastStopped() { return this.getStringAttribute('last_stopped'); } } exports.SyntheticsCanaryTimelineOutputReference = SyntheticsCanaryTimelineOutputReference; _a = JSII_RTTI_SYMBOL_1; SyntheticsCanaryTimelineOutputReference[_a] = { fqn: "@cdktf/provider-aws.syntheticsCanary.SyntheticsCanaryTimelineOutputReference", version: "21.22.1" }; class SyntheticsCanaryTimelineList extends cdktf.ComplexList { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource, terraformAttribute, wrapsSet) { super(terraformResource, terraformAttribute, wrapsSet); this.terraformResource = terraformResource; this.terraformAttribute = terraformAttribute; this.wrapsSet = wrapsSet; } /** * @param index the index of the item to return */ get(index) { return new SyntheticsCanaryTimelineOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.SyntheticsCanaryTimelineList = SyntheticsCanaryTimelineList; _b = JSII_RTTI_SYMBOL_1; SyntheticsCanaryTimelineList[_b] = { fqn: "@cdktf/provider-aws.syntheticsCanary.SyntheticsCanaryTimelineList", version: "21.22.1" }; function syntheticsCanaryArtifactConfigS3EncryptionToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { encryption_mode: cdktf.stringToTerraform(struct.encryptionMode), kms_key_arn: cdktf.stringToTerraform(struct.kmsKeyArn), }; } function syntheticsCanaryArtifactConfigS3EncryptionToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { encryption_mode: { value: cdktf.stringToHclTerraform(struct.encryptionMode), isBlock: false, type: "simple", storageClassType: "string", }, kms_key_arn: { value: cdktf.stringToHclTerraform(struct.kmsKeyArn), isBlock: false, type: "simple", storageClassType: "string", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class SyntheticsCanaryArtifactConfigS3EncryptionOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._encryptionMode !== undefined) { hasAnyValues = true; internalValueResult.encryptionMode = this._encryptionMode; } if (this._kmsKeyArn !== undefined) { hasAnyValues = true; internalValueResult.kmsKeyArn = this._kmsKeyArn; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._encryptionMode = undefined; this._kmsKeyArn = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._encryptionMode = value.encryptionMode; this._kmsKeyArn = value.kmsKeyArn; } } get encryptionMode() { return this.getStringAttribute('encryption_mode'); } set encryptionMode(value) { this._encryptionMode = value; } resetEncryptionMode() { this._encryptionMode = undefined; } // Temporarily expose input value. Use with caution. get encryptionModeInput() { return this._encryptionMode; } get kmsKeyArn() { return this.getStringAttribute('kms_key_arn'); } set kmsKeyArn(value) { this._kmsKeyArn = value; } resetKmsKeyArn() { this._kmsKeyArn = undefined; } // Temporarily expose input value. Use with caution. get kmsKeyArnInput() { return this._kmsKeyArn; } } exports.SyntheticsCanaryArtifactConfigS3EncryptionOutputReference = SyntheticsCanaryArtifactConfigS3EncryptionOutputReference; _c = JSII_RTTI_SYMBOL_1; SyntheticsCanaryArtifactConfigS3EncryptionOutputReference[_c] = { fqn: "@cdktf/provider-aws.syntheticsCanary.SyntheticsCanaryArtifactConfigS3EncryptionOutputReference", version: "21.22.1" }; function syntheticsCanaryArtifactConfigToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { s3_encryption: syntheticsCanaryArtifactConfigS3EncryptionToTerraform(struct.s3Encryption), }; } function syntheticsCanaryArtifactConfigToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { s3_encryption: { value: syntheticsCanaryArtifactConfigS3EncryptionToHclTerraform(struct.s3Encryption), isBlock: true, type: "list", storageClassType: "SyntheticsCanaryArtifactConfigS3EncryptionList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class SyntheticsCanaryArtifactConfigOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; // s3_encryption - computed: false, optional: true, required: false this._s3Encryption = new SyntheticsCanaryArtifactConfigS3EncryptionOutputReference(this, "s3_encryption"); } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._s3Encryption?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.s3Encryption = this._s3Encryption?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._s3Encryption.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._s3Encryption.internalValue = value.s3Encryption; } } get s3Encryption() { return this._s3Encryption; } putS3Encryption(value) { this._s3Encryption.internalValue = value; } resetS3Encryption() { this._s3Encryption.internalValue = undefined; } // Temporarily expose input value. Use with caution. get s3EncryptionInput() { return this._s3Encryption.internalValue; } } exports.SyntheticsCanaryArtifactConfigOutputReference = SyntheticsCanaryArtifactConfigOutputReference; _d = JSII_RTTI_SYMBOL_1; SyntheticsCanaryArtifactConfigOutputReference[_d] = { fqn: "@cdktf/provider-aws.syntheticsCanary.SyntheticsCanaryArtifactConfigOutputReference", version: "21.22.1" }; function syntheticsCanaryRunConfigToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { active_tracing: cdktf.booleanToTerraform(struct.activeTracing), environment_variables: cdktf.hashMapper(cdktf.stringToTerraform)(struct.environmentVariables), ephemeral_storage: cdktf.numberToTerraform(struct.ephemeralStorage), memory_in_mb: cdktf.numberToTerraform(struct.memoryInMb), timeout_in_seconds: cdktf.numberToTerraform(struct.timeoutInSeconds), }; } function syntheticsCanaryRunConfigToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { active_tracing: { value: cdktf.booleanToHclTerraform(struct.activeTracing), isBlock: false, type: "simple", storageClassType: "boolean", }, environment_variables: { value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct.environmentVariables), isBlock: false, type: "map", storageClassType: "stringMap", }, ephemeral_storage: { value: cdktf.numberToHclTerraform(struct.ephemeralStorage), isBlock: false, type: "simple", storageClassType: "number", }, memory_in_mb: { value: cdktf.numberToHclTerraform(struct.memoryInMb), isBlock: false, type: "simple", storageClassType: "number", }, timeout_in_seconds: { value: cdktf.numberToHclTerraform(struct.timeoutInSeconds), isBlock: false, type: "simple", storageClassType: "number", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class SyntheticsCanaryRunConfigOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._activeTracing !== undefined) { hasAnyValues = true; internalValueResult.activeTracing = this._activeTracing; } if (this._environmentVariables !== undefined) { hasAnyValues = true; internalValueResult.environmentVariables = this._environmentVariables; } if (this._ephemeralStorage !== undefined) { hasAnyValues = true; internalValueResult.ephemeralStorage = this._ephemeralStorage; } if (this._memoryInMb !== undefined) { hasAnyValues = true; internalValueResult.memoryInMb = this._memoryInMb; } if (this._timeoutInSeconds !== undefined) { hasAnyValues = true; internalValueResult.timeoutInSeconds = this._timeoutInSeconds; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._activeTracing = undefined; this._environmentVariables = undefined; this._ephemeralStorage = undefined; this._memoryInMb = undefined; this._timeoutInSeconds = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._activeTracing = value.activeTracing; this._environmentVariables = value.environmentVariables; this._ephemeralStorage = value.ephemeralStorage; this._memoryInMb = value.memoryInMb; this._timeoutInSeconds = value.timeoutInSeconds; } } get activeTracing() { return this.getBooleanAttribute('active_tracing'); } set activeTracing(value) { this._activeTracing = value; } resetActiveTracing() { this._activeTracing = undefined; } // Temporarily expose input value. Use with caution. get activeTracingInput() { return this._activeTracing; } get environmentVariables() { return this.getStringMapAttribute('environment_variables'); } set environmentVariables(value) { this._environmentVariables = value; } resetEnvironmentVariables() { this._environmentVariables = undefined; } // Temporarily expose input value. Use with caution. get environmentVariablesInput() { return this._environmentVariables; } get ephemeralStorage() { return this.getNumberAttribute('ephemeral_storage'); } set ephemeralStorage(value) { this._ephemeralStorage = value; } resetEphemeralStorage() { this._ephemeralStorage = undefined; } // Temporarily expose input value. Use with caution. get ephemeralStorageInput() { return this._ephemeralStorage; } get memoryInMb() { return this.getNumberAttribute('memory_in_mb'); } set memoryInMb(value) { this._memoryInMb = value; } resetMemoryInMb() { this._memoryInMb = undefined; } // Temporarily expose input value. Use with caution. get memoryInMbInput() { return this._memoryInMb; } get timeoutInSeconds() { return this.getNumberAttribute('timeout_in_seconds'); } set timeoutInSeconds(value) { this._timeoutInSeconds = value; } resetTimeoutInSeconds() { this._timeoutInSeconds = undefined; } // Temporarily expose input value. Use with caution. get timeoutInSecondsInput() { return this._timeoutInSeconds; } } exports.SyntheticsCanaryRunConfigOutputReference = SyntheticsCanaryRunConfigOutputReference; _e = JSII_RTTI_SYMBOL_1; SyntheticsCanaryRunConfigOutputReference[_e] = { fqn: "@cdktf/provider-aws.syntheticsCanary.SyntheticsCanaryRunConfigOutputReference", version: "21.22.1" }; function syntheticsCanaryScheduleRetryConfigToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { max_retries: cdktf.numberToTerraform(struct.maxRetries), }; } function syntheticsCanaryScheduleRetryConfigToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { max_retries: { value: cdktf.numberToHclTerraform(struct.maxRetries), isBlock: false, type: "simple", storageClassType: "number", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class SyntheticsCanaryScheduleRetryConfigOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._maxRetries !== undefined) { hasAnyValues = true; internalValueResult.maxRetries = this._maxRetries; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._maxRetries = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._maxRetries = value.maxRetries; } } get maxRetries() { return this.getNumberAttribute('max_retries'); } set maxRetries(value) { this._maxRetries = value; } // Temporarily expose input value. Use with caution. get maxRetriesInput() { return this._maxRetries; } } exports.SyntheticsCanaryScheduleRetryConfigOutputReference = SyntheticsCanaryScheduleRetryConfigOutputReference; _f = JSII_RTTI_SYMBOL_1; SyntheticsCanaryScheduleRetryConfigOutputReference[_f] = { fqn: "@cdktf/provider-aws.syntheticsCanary.SyntheticsCanaryScheduleRetryConfigOutputReference", version: "21.22.1" }; function syntheticsCanaryScheduleToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { duration_in_seconds: cdktf.numberToTerraform(struct.durationInSeconds), expression: cdktf.stringToTerraform(struct.expression), retry_config: syntheticsCanaryScheduleRetryConfigToTerraform(struct.retryConfig), }; } function syntheticsCanaryScheduleToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { duration_in_seconds: { value: cdktf.numberToHclTerraform(struct.durationInSeconds), isBlock: false, type: "simple", storageClassType: "number", }, expression: { value: cdktf.stringToHclTerraform(struct.expression), isBlock: false, type: "simple", storageClassType: "string", }, retry_config: { value: syntheticsCanaryScheduleRetryConfigToHclTerraform(struct.retryConfig), isBlock: true, type: "list", storageClassType: "SyntheticsCanaryScheduleRetryConfigList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class SyntheticsCanaryScheduleOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; // retry_config - computed: false, optional: true, required: false this._retryConfig = new SyntheticsCanaryScheduleRetryConfigOutputReference(this, "retry_config"); } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._durationInSeconds !== undefined) { hasAnyValues = true; internalValueResult.durationInSeconds = this._durationInSeconds; } if (this._expression !== undefined) { hasAnyValues = true; internalValueResult.expression = this._expression; } if (this._retryConfig?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.retryConfig = this._retryConfig?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._durationInSeconds = undefined; this._expression = undefined; this._retryConfig.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._durationInSeconds = value.durationInSeconds; this._expression = value.expression; this._retryConfig.internalValue = value.retryConfig; } } get durationInSeconds() { return this.getNumberAttribute('duration_in_seconds'); } set durationInSeconds(value) { this._durationInSeconds = value; } resetDurationInSeconds() { this._durationInSeconds = undefined; } // Temporarily expose input value. Use with caution. get durationInSecondsInput() { return this._durationInSeconds; } get expression() { return this.getStringAttribute('expression'); } set expression(value) { this._expression = value; } // Temporarily expose input value. Use with caution. get expressionInput() { return this._expression; } get retryConfig() { return this._retryConfig; } putRetryConfig(value) { this._retryConfig.internalValue = value; } resetRetryConfig() { this._retryConfig.internalValue = undefined; } // Temporarily expose input value. Use with caution. get retryConfigInput() { return this._retryConfig.internalValue; } } exports.SyntheticsCanaryScheduleOutputReference = SyntheticsCanaryScheduleOutputReference; _g = JSII_RTTI_SYMBOL_1; SyntheticsCanaryScheduleOutputReference[_g] = { fqn: "@cdktf/provider-aws.syntheticsCanary.SyntheticsCanaryScheduleOutputReference", version: "21.22.1" }; function syntheticsCanaryVpcConfigToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { ipv6_allowed_for_dual_stack: cdktf.booleanToTerraform(struct.ipv6AllowedForDualStack), security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.securityGroupIds), subnet_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.subnetIds), }; } function syntheticsCanaryVpcConfigToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { ipv6_allowed_for_dual_stack: { value: cdktf.booleanToHclTerraform(struct.ipv6AllowedForDualStack), isBlock: false, type: "simple", storageClassType: "boolean", }, security_group_ids: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.securityGroupIds), isBlock: false, type: "set", storageClassType: "stringList", }, subnet_ids: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.subnetIds), isBlock: false, type: "set", storageClassType: "stringList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class SyntheticsCanaryVpcConfigOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._ipv6AllowedForDualStack !== undefined) { hasAnyValues = true; internalValueResult.ipv6AllowedForDualStack = this._ipv6AllowedForDualStack; } if (this._securityGroupIds !== undefined) { hasAnyValues = true; internalValueResult.securityGroupIds = this._securityGroupIds; } if (this._subnetIds !== undefined) { hasAnyValues = true; internalValueResult.subnetIds = this._subnetIds; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._ipv6AllowedForDualStack = undefined; this._securityGroupIds = undefined; this._subnetIds = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._ipv6AllowedForDualStack = value.ipv6AllowedForDualStack; this._securityGroupIds = value.securityGroupIds; this._subnetIds = value.subnetIds; } } get ipv6AllowedForDualStack() { return this.getBooleanAttribute('ipv6_allowed_for_dual_stack'); } set ipv6AllowedForDualStack(value) { this._ipv6AllowedForDualStack = value; } resetIpv6AllowedForDualStack() { this._ipv6AllowedForDualStack = undefined; } // Temporarily expose input value. Use with caution. get ipv6AllowedForDualStackInput() { return this._ipv6AllowedForDualStack; } get securityGroupIds() { return cdktf.Fn.tolist(this.getListAttribute('security_group_ids')); } set securityGroupIds(value) { this._securityGroupIds = value; } resetSecurityGroupIds() { this._securityGroupIds = undefined; } // Temporarily expose input value. Use with caution. get securityGroupIdsInput() { return this._securityGroupIds; } get subnetIds() { return cdktf.Fn.tolist(this.getListAttribute('subnet_ids')); } set subnetIds(value) { this._subnetIds = value; } resetSubnetIds() { this._subnetIds = undefined; } // Temporarily expose input value. Use with caution. get subnetIdsInput() { return this._subnetIds; } // vpc_id - computed: true, optional: false, required: false get vpcId() { return this.getStringAttribute('vpc_id'); } } exports.SyntheticsCanaryVpcConfigOutputReference = SyntheticsCanaryVpcConfigOutputReference; _h = JSII_RTTI_SYMBOL_1; SyntheticsCanaryVpcConfigOutputReference[_h] = { fqn: "@cdktf/provider-aws.syntheticsCanary.SyntheticsCanaryVpcConfigOutputReference", version: "21.22.1" }; /** * Represents a {@link https://registry.terraform.io/providers/hashicorp/aws/6.25.0/docs/resources/synthetics_canary aws_synthetics_canary} */ class SyntheticsCanary extends cdktf.TerraformResource { // ============== // STATIC Methods // ============== /** * Generates CDKTF code for importing a SyntheticsCanary resource upon running "cdktf plan <stack-name>" * @param scope The scope in which to define this construct * @param importToId The construct id used in the generated config for the SyntheticsCanary to import * @param importFromId The id of the existing SyntheticsCanary that should be imported. Refer to the {@link https://registry.terraform.io/providers/hashicorp/aws/6.25.0/docs/resources/synthetics_canary#import import section} in the documentation of this resource for the id to use * @param provider? Optional instance of the provider where the SyntheticsCanary to import is found */ static generateConfigForImport(scope, importToId, importFromId, provider) { return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "aws_synthetics_canary", importId: importFromId, provider }); } // =========== // INITIALIZER // =========== /** * Create a new {@link https://registry.terraform.io/providers/hashicorp/aws/6.25.0/docs/resources/synthetics_canary aws_synthetics_canary} Resource * * @param scope The scope in which to define this construct * @param id The scoped construct ID. Must be unique amongst siblings in the same scope * @param options SyntheticsCanaryConfig */ constructor(scope, id, config) { super(scope, id, { terraformResourceType: 'aws_synthetics_canary', terraformGeneratorMetadata: { providerName: 'aws', providerVersion: '6.25.0', providerVersionConstraint: '~> 6.0' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle, provisioners: config.provisioners, connection: config.connection, forEach: config.forEach }); // timeline - computed: true, optional: false, required: false this._timeline = new SyntheticsCanaryTimelineList(this, "timeline", false); // artifact_config - computed: false, optional: true, required: false this._artifactConfig = new SyntheticsCanaryArtifactConfigOutputReference(this, "artifact_config"); // run_config - computed: false, optional: true, required: false this._runConfig = new SyntheticsCanaryRunConfigOutputReference(this, "run_config"); // schedule - computed: false, optional: false, required: true this._schedule = new SyntheticsCanaryScheduleOutputReference(this, "schedule"); // vpc_config - computed: false, optional: true, required: false this._vpcConfig = new SyntheticsCanaryVpcConfigOutputReference(this, "vpc_config"); this._artifactS3Location = config.artifactS3Location; this._deleteLambda = config.deleteLambda; this._executionRoleArn = config.executionRoleArn; this._failureRetentionPeriod = config.failureRetentionPeriod; this._handler = config.handler; this._id = config.id; this._name = config.name; this._region = config.region; this._runtimeVersion = config.runtimeVersion; this._s3Bucket = config.s3Bucket; this._s3Key = config.s3Key; this._s3Version = config.s3Version; this._startCanary = config.startCanary; this._successRetentionPeriod = config.successRetentionPeriod; this._tags = config.tags; this._tagsAll = config.tagsAll; this._zipFile = config.zipFile; this._artifactConfig.internalValue = config.artifactConfig; this._runConfig.internalValue = config.runConfig; this._schedule.internalValue = config.schedule; this._vpcConfig.internalValue = config.vpcConfig; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false get arn() { return this.getStringAttribute('arn'); } get artifactS3Location() { return this.getStringAttribute('artifact_s3_location'); } set artifactS3Location(value) { this._artifactS3Location = value; } // Temporarily expose input value. Use with caution. get artifactS3LocationInput() { return this._artifactS3Location; } get deleteLambda() { return this.getBooleanAttribute('delete_lambda'); } set deleteLambda(value) { this._deleteLambda = value; } resetDeleteLambda() { this._deleteLambda = undefined; } // Temporarily expose input value. Use with caution. get deleteLambdaInput() { return this._deleteLambda; } // engine_arn - computed: true, optional: false, required: false get engineArn() { return this.getStringAttribute('engine_arn'); } get executionRoleArn() { return this.getStringAttribute('execution_role_arn'); } set executionRoleArn(value) { this._executionRoleArn = value; } // Temporarily expose input value. Use with caution. get executionRoleArnInput() { return this._executionRoleArn; } get failureRetentionPeriod() { return this.getNumberAttribute('failure_retention_period'); } set failureRetentionPeriod(value) { this._failureRetentionPeriod = value; } resetFailureRetentionPeriod() { this._failureRetentionPeriod = undefined; } // Temporarily expose input value. Use with caution. get failureRetentionPeriodInput() { return this._failureRetentionPeriod; } get handler() { return this.getStringAttribute('handler'); } set handler(value) { this._handler = value; } // Temporarily expose input value. Use with caution. get handlerInput() { return this._handler; } get id() { return this.getStringAttribute('id'); } set id(value) { this._id = value; } resetId() { this._id = undefined; } // Temporarily expose input value. Use with caution. get idInput() { return this._id; } get name() { return this.getStringAttribute('name'); } set name(value) { this._name = value; } // Temporarily expose input value. Use with caution. get nameInput() { return this._name; } get region() { return this.getStringAttribute('region'); } set region(value) { this._region = value; } resetRegion() { this._region = undefined; } // Temporarily expose input value. Use with caution. get regionInput() { return this._region; } get runtimeVersion() { return this.getStringAttribute('runtime_version'); } set runtimeVersion(value) { this._runtimeVersion = value; } // Temporarily expose input value. Use with caution. get runtimeVersionInput() { return this._runtimeVersion; } get s3Bucket() { return this.getStringAttribute('s3_bucket'); } set s3Bucket(value) { this._s3Bucket = value; } resetS3Bucket() { this._s3Bucket = undefined; } // Temporarily expose input value. Use with caution. get s3BucketInput() { return this._s3Bucket; } get s3Key() { return this.getStringAttribute('s3_key'); } set s3Key(value) { this._s3Key = value; } resetS3Key() { this._s3Key = undefined; } // Temporarily expose input value. Use with caution. get s3KeyInput() { return this._s3Key; } get s3Version() { return this.getStringAttribute('s3_version'); } set s3Version(value) { this._s3Version = value; } resetS3Version() { this._s3Version = undefined; } // Temporarily expose input value. Use with caution. get s3VersionInput() { return this._s3Version; } // source_location_arn - computed: true, optional: false, required: false get sourceLocationArn() { return this.getStringAttribute('source_location_arn'); } get startCanary() { return this.getBooleanAttribute('start_canary'); } set startCanary(value) { this._startCanary = value; } resetStartCanary() { this._startCanary = undefined; } // Temporarily expose input value. Use with caution. get startCanaryInput() { return this._startCanary; } // status - computed: true, optional: false, required: false get status() { return this.getStringAttribute('status'); } get successRetentionPeriod() { return this.getNumberAttribute('success_retention_period'); } set successRetentionPeriod(value) { this._successRetentionPeriod = value; } resetSuccessRetentionPeriod() { this._successRetentionPeriod = undefined; } // Temporarily expose input value. Use with caution. get successRetentionPeriodInput() { return this._successRetentionPeriod; } get tags() { return this.getStringMapAttribute('tags'); } set tags(value) { this._tags = value; } resetTags() { this._tags = undefined; } // Temporarily expose input value. Use with caution. get tagsInput() { return this._tags; } get tagsAll() { return this.getStringMapAttribute('tags_all'); } set tagsAll(value) { this._tagsAll = value; } resetTagsAll() { this._tagsAll = undefined; } // Temporarily expose input value. Use with caution. get tagsAllInput() { return this._tagsAll; } get timeline() { return this._timeline; } get zipFile() { return this.getStringAttribute('zip_file'); } set zipFile(value) { this._zipFile = value; } resetZipFile() { this._zipFile = undefined; } // Temporarily expose input value. Use with caution. get zipFileInput() { return this._zipFile; } get artifactConfig() { return this._artifactConfig; } putArtifactConfig(value) { this._artifactConfig.internalValue = value; } resetArtifactConfig() { this._artifactConfig.internalValue = undefined; } // Temporarily expose input value. Use with caution. get artifactConfigInput() { return this._artifactConfig.internalValue; } get runConfig() { return this._runConfig; } putRunConfig(value) { this._runConfig.internalValue = value; } resetRunConfig() { this._runConfig.internalValue = undefined; } // Temporarily expose input value. Use with caution. get runConfigInput() { return this._runConfig.internalValue; } get schedule() { return this._schedule; } putSchedule(value) { this._schedule.internalValue = value; } // Temporarily expose input value. Use with caution. get scheduleInput() { return this._schedule.internalValue; } get vpcConfig() { return this._vpcConfig; } putVpcConfig(value) { this._vpcConfig.internalValue = value; } resetVpcConfig() { this._vpcConfig.internalValue = undefined; } // Temporarily expose input value. Use with caution. get vpcConfigInput() { return this._vpcConfig.internalValue; } // ========= // SYNTHESIS // ========= synthesizeAttributes() { return { artifact_s3_location: cdktf.stringToTerraform(this._artifactS3Location), delete_lambda: cdktf.booleanToTerraform(this._deleteLambda), execution_role_arn: cdktf.stringToTerraform(this._executionRoleArn), failure_retention_period: cdktf.numberToTerraform(this._failureRetentionPeriod), handler: cdktf.stringToTerraform(this._handler), id: cdktf.stringToTerraform(this._id), name: cdktf.stringToTerraform(this._name), region: cdktf.stringToTerraform(this._region), runtime_version: cdktf.stringToTerraform(this._runtimeVersion), s3_bucket: cdktf.stringToTerraform(this._s3Bucket), s3_key: cdktf.stringToTerraform(this._s3Key), s3_version: cdktf.stringToTerraform(this._s3Version), start_canary: cdktf.booleanToTerraform(this._startCanary), success_retention_period: cdktf.numberToTerraform(this._successRetentionPeriod), tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll), zip_file: cdktf.stringToTerraform(this._zipFile), artifact_config: syntheticsCanaryArtifactConfigToTerraform(this._artifactConfig.internalValue), run_config: syntheticsCanaryRunConfigToTerraform(this._runConfig.internalValue), schedule: syntheticsCanaryScheduleToTerraform(this._schedule.internalValue), vpc_config: syntheticsCanaryVpcConfigToTerraform(this._vpcConfig.internalValue), }; } synthesizeHclAttributes() { const attrs = { artifact_s3_location: { value: cdktf.stringToHclTerraform(this._artifactS3Location), isBlock: false, type: "simple", storageClassType: "string", }, delete_lambda: { value: cdktf.booleanToHclTerraform(this._deleteLambda), isBlock: false, type: "simple", storageClassType: "boolean", }, execution_role_arn: { value: cdktf.stringToHclTerraform(this._executionRoleArn), isBlock: false, type: "simple", storageClassType: "string", }, failure_retention_period: { value: cdktf.numberToHclTerraform(this._failureRetentionPeriod), isBlock: false, type: "simple", storageClassType: "number", }, handler: { value: cdktf.stringToHclTerraform(this._handler), isBlock: false, type: "simple", storageClassType: "string", }, id: { value: cdktf.stringToHclTerraform(this._id), isBlock: false, type: "simple", storageClassType: "string", }, name: { value: cdktf.stringToHclTerraform(this._name), isBlock: false, type: "simple", storageClassType: "string", }, region: { value: cdktf.stringToHclTerraform(this._region), isBlock: false, type: "simple", storageClassType: "string", }, runtime_version: { value: cdktf.stringToHclTerraform(this._runtimeVersion), isBlock: false, type: "simple", storageClassType: "string", }, s3_bucket: { value: cdktf.stringToHclTerraform(this._s3Bucket), isBlock: false, type: "simple", storageClassType: "string", }, s3_key: { value: cdktf.stringToHclTerraform(this._s3Key), isBlock: false, type: "simple", storageClassType: "string", }, s3_version: { value: cdktf.stringToHclTerraform(this._s3Version), isBlock: false, type: "simple", storageClassType: "string", }, start_canary: { value: cdktf.booleanToHclTerraform(this._startCanary), isBlock: false, type: "simple", storageClassType: "boolean", }, success_retention_period: { value: cdktf.numberToHclTerraform(this._successRetentionPeriod), isBlock: false, type: "simple", storageClassType: "number", }, tags: { value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), isBlock: false, type: "map", storageClassType: "stringMap", }, tags_all: { value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tagsAll), isBlock: false, type: "map", storageClassType: "stringMap", }, zip_file: { value: cdktf.stringToHclTerraform(this._zipFile), isBlock: false, type: "simple", storageClassType: "string", }, artifact_config: { value: syntheticsCanaryArtifactConfigToHclTerraf