// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS CodeDeploy */ export interface CodedeployDeploymentConfigConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#compute_platform CodedeployDeploymentConfig#compute_platform} */ readonly computePlatform?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#deployment_config_name CodedeployDeploymentConfig#deployment_config_name} */ readonly deploymentConfigName: string; /** * minimum_healthy_hosts block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#minimum_healthy_hosts CodedeployDeploymentConfig#minimum_healthy_hosts} */ readonly minimumHealthyHosts?: CodedeployDeploymentConfigMinimumHealthyHosts; /** * traffic_routing_config block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#traffic_routing_config CodedeployDeploymentConfig#traffic_routing_config} */ readonly trafficRoutingConfig?: CodedeployDeploymentConfigTrafficRoutingConfig; } export interface CodedeployDeploymentConfigMinimumHealthyHosts { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#type CodedeployDeploymentConfig#type} */ readonly type?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#value CodedeployDeploymentConfig#value} */ readonly value?: number; } export function codedeployDeploymentConfigMinimumHealthyHostsToTerraform(struct?: CodedeployDeploymentConfigMinimumHealthyHostsOutputReference | CodedeployDeploymentConfigMinimumHealthyHosts): any { if (!cdktf.canInspect(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 { type: cdktf.stringToTerraform(struct!.type), value: cdktf.numberToTerraform(struct!.value), } } export class CodedeployDeploymentConfigMinimumHealthyHostsOutputReference extends cdktf.ComplexObject { private isEmptyObject = false; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param isSingleItem True if this is a block, false if it's a list */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): CodedeployDeploymentConfigMinimumHealthyHosts | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._type !== undefined) { hasAnyValues = true; internalValueResult.type = this._type; } if (this._value !== undefined) { hasAnyValues = true; internalValueResult.value = this._value; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: CodedeployDeploymentConfigMinimumHealthyHosts | undefined) { if (value === undefined) { this.isEmptyObject = false; this._type = undefined; this._value = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._type = value.type; this._value = value.value; } } // type - computed: false, optional: true, required: false private _type?: string; public get type() { return this.getStringAttribute('type'); } public set type(value: string) { this._type = value; } public resetType() { this._type = undefined; } // Temporarily expose input value. Use with caution. public get typeInput() { return this._type; } // value - computed: false, optional: true, required: false private _value?: number; public get value() { return this.getNumberAttribute('value'); } public set value(value: number) { this._value = value; } public resetValue() { this._value = undefined; } // Temporarily expose input value. Use with caution. public get valueInput() { return this._value; } } export interface CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanary { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#interval CodedeployDeploymentConfig#interval} */ readonly interval?: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#percentage CodedeployDeploymentConfig#percentage} */ readonly percentage?: number; } export function codedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanaryToTerraform(struct?: CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanaryOutputReference | CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanary): any { if (!cdktf.canInspect(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 { interval: cdktf.numberToTerraform(struct!.interval), percentage: cdktf.numberToTerraform(struct!.percentage), } } export class CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanaryOutputReference extends cdktf.ComplexObject { private isEmptyObject = false; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param isSingleItem True if this is a block, false if it's a list */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanary | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._interval !== undefined) { hasAnyValues = true; internalValueResult.interval = this._interval; } if (this._percentage !== undefined) { hasAnyValues = true; internalValueResult.percentage = this._percentage; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanary | undefined) { if (value === undefined) { this.isEmptyObject = false; this._interval = undefined; this._percentage = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._interval = value.interval; this._percentage = value.percentage; } } // interval - computed: false, optional: true, required: false private _interval?: number; public get interval() { return this.getNumberAttribute('interval'); } public set interval(value: number) { this._interval = value; } public resetInterval() { this._interval = undefined; } // Temporarily expose input value. Use with caution. public get intervalInput() { return this._interval; } // percentage - computed: false, optional: true, required: false private _percentage?: number; public get percentage() { return this.getNumberAttribute('percentage'); } public set percentage(value: number) { this._percentage = value; } public resetPercentage() { this._percentage = undefined; } // Temporarily expose input value. Use with caution. public get percentageInput() { return this._percentage; } } export interface CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinear { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#interval CodedeployDeploymentConfig#interval} */ readonly interval?: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#percentage CodedeployDeploymentConfig#percentage} */ readonly percentage?: number; } export function codedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinearToTerraform(struct?: CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinearOutputReference | CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinear): any { if (!cdktf.canInspect(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 { interval: cdktf.numberToTerraform(struct!.interval), percentage: cdktf.numberToTerraform(struct!.percentage), } } export class CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinearOutputReference extends cdktf.ComplexObject { private isEmptyObject = false; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param isSingleItem True if this is a block, false if it's a list */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinear | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._interval !== undefined) { hasAnyValues = true; internalValueResult.interval = this._interval; } if (this._percentage !== undefined) { hasAnyValues = true; internalValueResult.percentage = this._percentage; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinear | undefined) { if (value === undefined) { this.isEmptyObject = false; this._interval = undefined; this._percentage = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._interval = value.interval; this._percentage = value.percentage; } } // interval - computed: false, optional: true, required: false private _interval?: number; public get interval() { return this.getNumberAttribute('interval'); } public set interval(value: number) { this._interval = value; } public resetInterval() { this._interval = undefined; } // Temporarily expose input value. Use with caution. public get intervalInput() { return this._interval; } // percentage - computed: false, optional: true, required: false private _percentage?: number; public get percentage() { return this.getNumberAttribute('percentage'); } public set percentage(value: number) { this._percentage = value; } public resetPercentage() { this._percentage = undefined; } // Temporarily expose input value. Use with caution. public get percentageInput() { return this._percentage; } } export interface CodedeployDeploymentConfigTrafficRoutingConfig { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#type CodedeployDeploymentConfig#type} */ readonly type?: string; /** * time_based_canary block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#time_based_canary CodedeployDeploymentConfig#time_based_canary} */ readonly timeBasedCanary?: CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanary; /** * time_based_linear block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html#time_based_linear CodedeployDeploymentConfig#time_based_linear} */ readonly timeBasedLinear?: CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinear; } export function codedeployDeploymentConfigTrafficRoutingConfigToTerraform(struct?: CodedeployDeploymentConfigTrafficRoutingConfigOutputReference | CodedeployDeploymentConfigTrafficRoutingConfig): any { if (!cdktf.canInspect(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 { type: cdktf.stringToTerraform(struct!.type), time_based_canary: codedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanaryToTerraform(struct!.timeBasedCanary), time_based_linear: codedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinearToTerraform(struct!.timeBasedLinear), } } export class CodedeployDeploymentConfigTrafficRoutingConfigOutputReference extends cdktf.ComplexObject { private isEmptyObject = false; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param isSingleItem True if this is a block, false if it's a list */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): CodedeployDeploymentConfigTrafficRoutingConfig | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._type !== undefined) { hasAnyValues = true; internalValueResult.type = this._type; } if (this._timeBasedCanary?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.timeBasedCanary = this._timeBasedCanary?.internalValue; } if (this._timeBasedLinear?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.timeBasedLinear = this._timeBasedLinear?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: CodedeployDeploymentConfigTrafficRoutingConfig | undefined) { if (value === undefined) { this.isEmptyObject = false; this._type = undefined; this._timeBasedCanary.internalValue = undefined; this._timeBasedLinear.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._type = value.type; this._timeBasedCanary.internalValue = value.timeBasedCanary; this._timeBasedLinear.internalValue = value.timeBasedLinear; } } // type - computed: false, optional: true, required: false private _type?: string; public get type() { return this.getStringAttribute('type'); } public set type(value: string) { this._type = value; } public resetType() { this._type = undefined; } // Temporarily expose input value. Use with caution. public get typeInput() { return this._type; } // time_based_canary - computed: false, optional: true, required: false private _timeBasedCanary = new CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanaryOutputReference(this as any, "time_based_canary", true); public get timeBasedCanary() { return this._timeBasedCanary; } public putTimeBasedCanary(value: CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanary) { this._timeBasedCanary.internalValue = value; } public resetTimeBasedCanary() { this._timeBasedCanary.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get timeBasedCanaryInput() { return this._timeBasedCanary.internalValue; } // time_based_linear - computed: false, optional: true, required: false private _timeBasedLinear = new CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinearOutputReference(this as any, "time_based_linear", true); public get timeBasedLinear() { return this._timeBasedLinear; } public putTimeBasedLinear(value: CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinear) { this._timeBasedLinear.internalValue = value; } public resetTimeBasedLinear() { this._timeBasedLinear.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get timeBasedLinearInput() { return this._timeBasedLinear.internalValue; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html aws_codedeploy_deployment_config} */ export class CodedeployDeploymentConfig extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_codedeploy_deployment_config"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config.html aws_codedeploy_deployment_config} 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 CodedeployDeploymentConfigConfig */ public constructor(scope: Construct, id: string, config: CodedeployDeploymentConfigConfig) { super(scope, id, { terraformResourceType: 'aws_codedeploy_deployment_config', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._computePlatform = config.computePlatform; this._deploymentConfigName = config.deploymentConfigName; this._minimumHealthyHosts.internalValue = config.minimumHealthyHosts; this._trafficRoutingConfig.internalValue = config.trafficRoutingConfig; } // ========== // ATTRIBUTES // ========== // compute_platform - computed: false, optional: true, required: false private _computePlatform?: string; public get computePlatform() { return this.getStringAttribute('compute_platform'); } public set computePlatform(value: string) { this._computePlatform = value; } public resetComputePlatform() { this._computePlatform = undefined; } // Temporarily expose input value. Use with caution. public get computePlatformInput() { return this._computePlatform; } // deployment_config_id - computed: true, optional: false, required: false public get deploymentConfigId() { return this.getStringAttribute('deployment_config_id'); } // deployment_config_name - computed: false, optional: false, required: true private _deploymentConfigName?: string; public get deploymentConfigName() { return this.getStringAttribute('deployment_config_name'); } public set deploymentConfigName(value: string) { this._deploymentConfigName = value; } // Temporarily expose input value. Use with caution. public get deploymentConfigNameInput() { return this._deploymentConfigName; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // minimum_healthy_hosts - computed: false, optional: true, required: false private _minimumHealthyHosts = new CodedeployDeploymentConfigMinimumHealthyHostsOutputReference(this as any, "minimum_healthy_hosts", true); public get minimumHealthyHosts() { return this._minimumHealthyHosts; } public putMinimumHealthyHosts(value: CodedeployDeploymentConfigMinimumHealthyHosts) { this._minimumHealthyHosts.internalValue = value; } public resetMinimumHealthyHosts() { this._minimumHealthyHosts.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get minimumHealthyHostsInput() { return this._minimumHealthyHosts.internalValue; } // traffic_routing_config - computed: false, optional: true, required: false private _trafficRoutingConfig = new CodedeployDeploymentConfigTrafficRoutingConfigOutputReference(this as any, "traffic_routing_config", true); public get trafficRoutingConfig() { return this._trafficRoutingConfig; } public putTrafficRoutingConfig(value: CodedeployDeploymentConfigTrafficRoutingConfig) { this._trafficRoutingConfig.internalValue = value; } public resetTrafficRoutingConfig() { this._trafficRoutingConfig.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get trafficRoutingConfigInput() { return this._trafficRoutingConfig.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { compute_platform: cdktf.stringToTerraform(this._computePlatform), deployment_config_name: cdktf.stringToTerraform(this._deploymentConfigName), minimum_healthy_hosts: codedeployDeploymentConfigMinimumHealthyHostsToTerraform(this._minimumHealthyHosts.internalValue), traffic_routing_config: codedeployDeploymentConfigTrafficRoutingConfigToTerraform(this._trafficRoutingConfig.internalValue), }; } }