// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS EC2 */ export interface Ec2FleetConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#excess_capacity_termination_policy Ec2Fleet#excess_capacity_termination_policy} */ readonly excessCapacityTerminationPolicy?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#replace_unhealthy_instances Ec2Fleet#replace_unhealthy_instances} */ readonly replaceUnhealthyInstances?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#tags Ec2Fleet#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#tags_all Ec2Fleet#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#terminate_instances Ec2Fleet#terminate_instances} */ readonly terminateInstances?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#terminate_instances_with_expiration Ec2Fleet#terminate_instances_with_expiration} */ readonly terminateInstancesWithExpiration?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#type Ec2Fleet#type} */ readonly type?: string; /** * launch_template_config block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#launch_template_config Ec2Fleet#launch_template_config} */ readonly launchTemplateConfig: Ec2FleetLaunchTemplateConfig; /** * on_demand_options block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#on_demand_options Ec2Fleet#on_demand_options} */ readonly onDemandOptions?: Ec2FleetOnDemandOptions; /** * spot_options block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#spot_options Ec2Fleet#spot_options} */ readonly spotOptions?: Ec2FleetSpotOptions; /** * target_capacity_specification block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#target_capacity_specification Ec2Fleet#target_capacity_specification} */ readonly targetCapacitySpecification: Ec2FleetTargetCapacitySpecification; /** * timeouts block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#timeouts Ec2Fleet#timeouts} */ readonly timeouts?: Ec2FleetTimeouts; } export interface Ec2FleetLaunchTemplateConfigLaunchTemplateSpecification { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#launch_template_id Ec2Fleet#launch_template_id} */ readonly launchTemplateId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#launch_template_name Ec2Fleet#launch_template_name} */ readonly launchTemplateName?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#version Ec2Fleet#version} */ readonly version: string; } export function ec2FleetLaunchTemplateConfigLaunchTemplateSpecificationToTerraform(struct?: Ec2FleetLaunchTemplateConfigLaunchTemplateSpecificationOutputReference | Ec2FleetLaunchTemplateConfigLaunchTemplateSpecification): 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 { launch_template_id: cdktf.stringToTerraform(struct!.launchTemplateId), launch_template_name: cdktf.stringToTerraform(struct!.launchTemplateName), version: cdktf.stringToTerraform(struct!.version), } } export class Ec2FleetLaunchTemplateConfigLaunchTemplateSpecificationOutputReference 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(): Ec2FleetLaunchTemplateConfigLaunchTemplateSpecification | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._launchTemplateId !== undefined) { hasAnyValues = true; internalValueResult.launchTemplateId = this._launchTemplateId; } if (this._launchTemplateName !== undefined) { hasAnyValues = true; internalValueResult.launchTemplateName = this._launchTemplateName; } if (this._version !== undefined) { hasAnyValues = true; internalValueResult.version = this._version; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: Ec2FleetLaunchTemplateConfigLaunchTemplateSpecification | undefined) { if (value === undefined) { this.isEmptyObject = false; this._launchTemplateId = undefined; this._launchTemplateName = undefined; this._version = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._launchTemplateId = value.launchTemplateId; this._launchTemplateName = value.launchTemplateName; this._version = value.version; } } // launch_template_id - computed: false, optional: true, required: false private _launchTemplateId?: string; public get launchTemplateId() { return this.getStringAttribute('launch_template_id'); } public set launchTemplateId(value: string) { this._launchTemplateId = value; } public resetLaunchTemplateId() { this._launchTemplateId = undefined; } // Temporarily expose input value. Use with caution. public get launchTemplateIdInput() { return this._launchTemplateId; } // launch_template_name - computed: false, optional: true, required: false private _launchTemplateName?: string; public get launchTemplateName() { return this.getStringAttribute('launch_template_name'); } public set launchTemplateName(value: string) { this._launchTemplateName = value; } public resetLaunchTemplateName() { this._launchTemplateName = undefined; } // Temporarily expose input value. Use with caution. public get launchTemplateNameInput() { return this._launchTemplateName; } // version - computed: false, optional: false, required: true private _version?: string; public get version() { return this.getStringAttribute('version'); } public set version(value: string) { this._version = value; } // Temporarily expose input value. Use with caution. public get versionInput() { return this._version; } } export interface Ec2FleetLaunchTemplateConfigOverride { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#availability_zone Ec2Fleet#availability_zone} */ readonly availabilityZone?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#instance_type Ec2Fleet#instance_type} */ readonly instanceType?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#max_price Ec2Fleet#max_price} */ readonly maxPrice?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#priority Ec2Fleet#priority} */ readonly priority?: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#subnet_id Ec2Fleet#subnet_id} */ readonly subnetId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#weighted_capacity Ec2Fleet#weighted_capacity} */ readonly weightedCapacity?: number; } export function ec2FleetLaunchTemplateConfigOverrideToTerraform(struct?: Ec2FleetLaunchTemplateConfigOverride): 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 { availability_zone: cdktf.stringToTerraform(struct!.availabilityZone), instance_type: cdktf.stringToTerraform(struct!.instanceType), max_price: cdktf.stringToTerraform(struct!.maxPrice), priority: cdktf.numberToTerraform(struct!.priority), subnet_id: cdktf.stringToTerraform(struct!.subnetId), weighted_capacity: cdktf.numberToTerraform(struct!.weightedCapacity), } } export interface Ec2FleetLaunchTemplateConfig { /** * launch_template_specification block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#launch_template_specification Ec2Fleet#launch_template_specification} */ readonly launchTemplateSpecification: Ec2FleetLaunchTemplateConfigLaunchTemplateSpecification; /** * override block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#override Ec2Fleet#override} */ readonly override?: Ec2FleetLaunchTemplateConfigOverride[]; } export function ec2FleetLaunchTemplateConfigToTerraform(struct?: Ec2FleetLaunchTemplateConfigOutputReference | Ec2FleetLaunchTemplateConfig): 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 { launch_template_specification: ec2FleetLaunchTemplateConfigLaunchTemplateSpecificationToTerraform(struct!.launchTemplateSpecification), override: cdktf.listMapper(ec2FleetLaunchTemplateConfigOverrideToTerraform)(struct!.override), } } export class Ec2FleetLaunchTemplateConfigOutputReference 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(): Ec2FleetLaunchTemplateConfig | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._launchTemplateSpecification?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.launchTemplateSpecification = this._launchTemplateSpecification?.internalValue; } if (this._override !== undefined) { hasAnyValues = true; internalValueResult.override = this._override; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: Ec2FleetLaunchTemplateConfig | undefined) { if (value === undefined) { this.isEmptyObject = false; this._launchTemplateSpecification.internalValue = undefined; this._override = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._launchTemplateSpecification.internalValue = value.launchTemplateSpecification; this._override = value.override; } } // launch_template_specification - computed: false, optional: false, required: true private _launchTemplateSpecification = new Ec2FleetLaunchTemplateConfigLaunchTemplateSpecificationOutputReference(this as any, "launch_template_specification", true); public get launchTemplateSpecification() { return this._launchTemplateSpecification; } public putLaunchTemplateSpecification(value: Ec2FleetLaunchTemplateConfigLaunchTemplateSpecification) { this._launchTemplateSpecification.internalValue = value; } // Temporarily expose input value. Use with caution. public get launchTemplateSpecificationInput() { return this._launchTemplateSpecification.internalValue; } // override - computed: false, optional: true, required: false private _override?: Ec2FleetLaunchTemplateConfigOverride[]; public get override() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('override') as any; } public set override(value: Ec2FleetLaunchTemplateConfigOverride[]) { this._override = value; } public resetOverride() { this._override = undefined; } // Temporarily expose input value. Use with caution. public get overrideInput() { return this._override; } } export interface Ec2FleetOnDemandOptions { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#allocation_strategy Ec2Fleet#allocation_strategy} */ readonly allocationStrategy?: string; } export function ec2FleetOnDemandOptionsToTerraform(struct?: Ec2FleetOnDemandOptionsOutputReference | Ec2FleetOnDemandOptions): 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 { allocation_strategy: cdktf.stringToTerraform(struct!.allocationStrategy), } } export class Ec2FleetOnDemandOptionsOutputReference 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(): Ec2FleetOnDemandOptions | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._allocationStrategy !== undefined) { hasAnyValues = true; internalValueResult.allocationStrategy = this._allocationStrategy; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: Ec2FleetOnDemandOptions | undefined) { if (value === undefined) { this.isEmptyObject = false; this._allocationStrategy = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._allocationStrategy = value.allocationStrategy; } } // allocation_strategy - computed: false, optional: true, required: false private _allocationStrategy?: string; public get allocationStrategy() { return this.getStringAttribute('allocation_strategy'); } public set allocationStrategy(value: string) { this._allocationStrategy = value; } public resetAllocationStrategy() { this._allocationStrategy = undefined; } // Temporarily expose input value. Use with caution. public get allocationStrategyInput() { return this._allocationStrategy; } } export interface Ec2FleetSpotOptionsMaintenanceStrategiesCapacityRebalance { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#replacement_strategy Ec2Fleet#replacement_strategy} */ readonly replacementStrategy?: string; } export function ec2FleetSpotOptionsMaintenanceStrategiesCapacityRebalanceToTerraform(struct?: Ec2FleetSpotOptionsMaintenanceStrategiesCapacityRebalanceOutputReference | Ec2FleetSpotOptionsMaintenanceStrategiesCapacityRebalance): 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 { replacement_strategy: cdktf.stringToTerraform(struct!.replacementStrategy), } } export class Ec2FleetSpotOptionsMaintenanceStrategiesCapacityRebalanceOutputReference 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(): Ec2FleetSpotOptionsMaintenanceStrategiesCapacityRebalance | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._replacementStrategy !== undefined) { hasAnyValues = true; internalValueResult.replacementStrategy = this._replacementStrategy; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: Ec2FleetSpotOptionsMaintenanceStrategiesCapacityRebalance | undefined) { if (value === undefined) { this.isEmptyObject = false; this._replacementStrategy = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._replacementStrategy = value.replacementStrategy; } } // replacement_strategy - computed: false, optional: true, required: false private _replacementStrategy?: string; public get replacementStrategy() { return this.getStringAttribute('replacement_strategy'); } public set replacementStrategy(value: string) { this._replacementStrategy = value; } public resetReplacementStrategy() { this._replacementStrategy = undefined; } // Temporarily expose input value. Use with caution. public get replacementStrategyInput() { return this._replacementStrategy; } } export interface Ec2FleetSpotOptionsMaintenanceStrategies { /** * capacity_rebalance block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#capacity_rebalance Ec2Fleet#capacity_rebalance} */ readonly capacityRebalance?: Ec2FleetSpotOptionsMaintenanceStrategiesCapacityRebalance; } export function ec2FleetSpotOptionsMaintenanceStrategiesToTerraform(struct?: Ec2FleetSpotOptionsMaintenanceStrategiesOutputReference | Ec2FleetSpotOptionsMaintenanceStrategies): 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 { capacity_rebalance: ec2FleetSpotOptionsMaintenanceStrategiesCapacityRebalanceToTerraform(struct!.capacityRebalance), } } export class Ec2FleetSpotOptionsMaintenanceStrategiesOutputReference 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(): Ec2FleetSpotOptionsMaintenanceStrategies | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._capacityRebalance?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.capacityRebalance = this._capacityRebalance?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: Ec2FleetSpotOptionsMaintenanceStrategies | undefined) { if (value === undefined) { this.isEmptyObject = false; this._capacityRebalance.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._capacityRebalance.internalValue = value.capacityRebalance; } } // capacity_rebalance - computed: false, optional: true, required: false private _capacityRebalance = new Ec2FleetSpotOptionsMaintenanceStrategiesCapacityRebalanceOutputReference(this as any, "capacity_rebalance", true); public get capacityRebalance() { return this._capacityRebalance; } public putCapacityRebalance(value: Ec2FleetSpotOptionsMaintenanceStrategiesCapacityRebalance) { this._capacityRebalance.internalValue = value; } public resetCapacityRebalance() { this._capacityRebalance.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get capacityRebalanceInput() { return this._capacityRebalance.internalValue; } } export interface Ec2FleetSpotOptions { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#allocation_strategy Ec2Fleet#allocation_strategy} */ readonly allocationStrategy?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#instance_interruption_behavior Ec2Fleet#instance_interruption_behavior} */ readonly instanceInterruptionBehavior?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#instance_pools_to_use_count Ec2Fleet#instance_pools_to_use_count} */ readonly instancePoolsToUseCount?: number; /** * maintenance_strategies block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#maintenance_strategies Ec2Fleet#maintenance_strategies} */ readonly maintenanceStrategies?: Ec2FleetSpotOptionsMaintenanceStrategies; } export function ec2FleetSpotOptionsToTerraform(struct?: Ec2FleetSpotOptionsOutputReference | Ec2FleetSpotOptions): 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 { allocation_strategy: cdktf.stringToTerraform(struct!.allocationStrategy), instance_interruption_behavior: cdktf.stringToTerraform(struct!.instanceInterruptionBehavior), instance_pools_to_use_count: cdktf.numberToTerraform(struct!.instancePoolsToUseCount), maintenance_strategies: ec2FleetSpotOptionsMaintenanceStrategiesToTerraform(struct!.maintenanceStrategies), } } export class Ec2FleetSpotOptionsOutputReference 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(): Ec2FleetSpotOptions | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._allocationStrategy !== undefined) { hasAnyValues = true; internalValueResult.allocationStrategy = this._allocationStrategy; } if (this._instanceInterruptionBehavior !== undefined) { hasAnyValues = true; internalValueResult.instanceInterruptionBehavior = this._instanceInterruptionBehavior; } if (this._instancePoolsToUseCount !== undefined) { hasAnyValues = true; internalValueResult.instancePoolsToUseCount = this._instancePoolsToUseCount; } if (this._maintenanceStrategies?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.maintenanceStrategies = this._maintenanceStrategies?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: Ec2FleetSpotOptions | undefined) { if (value === undefined) { this.isEmptyObject = false; this._allocationStrategy = undefined; this._instanceInterruptionBehavior = undefined; this._instancePoolsToUseCount = undefined; this._maintenanceStrategies.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._allocationStrategy = value.allocationStrategy; this._instanceInterruptionBehavior = value.instanceInterruptionBehavior; this._instancePoolsToUseCount = value.instancePoolsToUseCount; this._maintenanceStrategies.internalValue = value.maintenanceStrategies; } } // allocation_strategy - computed: false, optional: true, required: false private _allocationStrategy?: string; public get allocationStrategy() { return this.getStringAttribute('allocation_strategy'); } public set allocationStrategy(value: string) { this._allocationStrategy = value; } public resetAllocationStrategy() { this._allocationStrategy = undefined; } // Temporarily expose input value. Use with caution. public get allocationStrategyInput() { return this._allocationStrategy; } // instance_interruption_behavior - computed: false, optional: true, required: false private _instanceInterruptionBehavior?: string; public get instanceInterruptionBehavior() { return this.getStringAttribute('instance_interruption_behavior'); } public set instanceInterruptionBehavior(value: string) { this._instanceInterruptionBehavior = value; } public resetInstanceInterruptionBehavior() { this._instanceInterruptionBehavior = undefined; } // Temporarily expose input value. Use with caution. public get instanceInterruptionBehaviorInput() { return this._instanceInterruptionBehavior; } // instance_pools_to_use_count - computed: false, optional: true, required: false private _instancePoolsToUseCount?: number; public get instancePoolsToUseCount() { return this.getNumberAttribute('instance_pools_to_use_count'); } public set instancePoolsToUseCount(value: number) { this._instancePoolsToUseCount = value; } public resetInstancePoolsToUseCount() { this._instancePoolsToUseCount = undefined; } // Temporarily expose input value. Use with caution. public get instancePoolsToUseCountInput() { return this._instancePoolsToUseCount; } // maintenance_strategies - computed: false, optional: true, required: false private _maintenanceStrategies = new Ec2FleetSpotOptionsMaintenanceStrategiesOutputReference(this as any, "maintenance_strategies", true); public get maintenanceStrategies() { return this._maintenanceStrategies; } public putMaintenanceStrategies(value: Ec2FleetSpotOptionsMaintenanceStrategies) { this._maintenanceStrategies.internalValue = value; } public resetMaintenanceStrategies() { this._maintenanceStrategies.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get maintenanceStrategiesInput() { return this._maintenanceStrategies.internalValue; } } export interface Ec2FleetTargetCapacitySpecification { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#default_target_capacity_type Ec2Fleet#default_target_capacity_type} */ readonly defaultTargetCapacityType: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#on_demand_target_capacity Ec2Fleet#on_demand_target_capacity} */ readonly onDemandTargetCapacity?: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#spot_target_capacity Ec2Fleet#spot_target_capacity} */ readonly spotTargetCapacity?: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#total_target_capacity Ec2Fleet#total_target_capacity} */ readonly totalTargetCapacity: number; } export function ec2FleetTargetCapacitySpecificationToTerraform(struct?: Ec2FleetTargetCapacitySpecificationOutputReference | Ec2FleetTargetCapacitySpecification): 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 { default_target_capacity_type: cdktf.stringToTerraform(struct!.defaultTargetCapacityType), on_demand_target_capacity: cdktf.numberToTerraform(struct!.onDemandTargetCapacity), spot_target_capacity: cdktf.numberToTerraform(struct!.spotTargetCapacity), total_target_capacity: cdktf.numberToTerraform(struct!.totalTargetCapacity), } } export class Ec2FleetTargetCapacitySpecificationOutputReference 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(): Ec2FleetTargetCapacitySpecification | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._defaultTargetCapacityType !== undefined) { hasAnyValues = true; internalValueResult.defaultTargetCapacityType = this._defaultTargetCapacityType; } if (this._onDemandTargetCapacity !== undefined) { hasAnyValues = true; internalValueResult.onDemandTargetCapacity = this._onDemandTargetCapacity; } if (this._spotTargetCapacity !== undefined) { hasAnyValues = true; internalValueResult.spotTargetCapacity = this._spotTargetCapacity; } if (this._totalTargetCapacity !== undefined) { hasAnyValues = true; internalValueResult.totalTargetCapacity = this._totalTargetCapacity; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: Ec2FleetTargetCapacitySpecification | undefined) { if (value === undefined) { this.isEmptyObject = false; this._defaultTargetCapacityType = undefined; this._onDemandTargetCapacity = undefined; this._spotTargetCapacity = undefined; this._totalTargetCapacity = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._defaultTargetCapacityType = value.defaultTargetCapacityType; this._onDemandTargetCapacity = value.onDemandTargetCapacity; this._spotTargetCapacity = value.spotTargetCapacity; this._totalTargetCapacity = value.totalTargetCapacity; } } // default_target_capacity_type - computed: false, optional: false, required: true private _defaultTargetCapacityType?: string; public get defaultTargetCapacityType() { return this.getStringAttribute('default_target_capacity_type'); } public set defaultTargetCapacityType(value: string) { this._defaultTargetCapacityType = value; } // Temporarily expose input value. Use with caution. public get defaultTargetCapacityTypeInput() { return this._defaultTargetCapacityType; } // on_demand_target_capacity - computed: false, optional: true, required: false private _onDemandTargetCapacity?: number; public get onDemandTargetCapacity() { return this.getNumberAttribute('on_demand_target_capacity'); } public set onDemandTargetCapacity(value: number) { this._onDemandTargetCapacity = value; } public resetOnDemandTargetCapacity() { this._onDemandTargetCapacity = undefined; } // Temporarily expose input value. Use with caution. public get onDemandTargetCapacityInput() { return this._onDemandTargetCapacity; } // spot_target_capacity - computed: false, optional: true, required: false private _spotTargetCapacity?: number; public get spotTargetCapacity() { return this.getNumberAttribute('spot_target_capacity'); } public set spotTargetCapacity(value: number) { this._spotTargetCapacity = value; } public resetSpotTargetCapacity() { this._spotTargetCapacity = undefined; } // Temporarily expose input value. Use with caution. public get spotTargetCapacityInput() { return this._spotTargetCapacity; } // total_target_capacity - computed: false, optional: false, required: true private _totalTargetCapacity?: number; public get totalTargetCapacity() { return this.getNumberAttribute('total_target_capacity'); } public set totalTargetCapacity(value: number) { this._totalTargetCapacity = value; } // Temporarily expose input value. Use with caution. public get totalTargetCapacityInput() { return this._totalTargetCapacity; } } export interface Ec2FleetTimeouts { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#create Ec2Fleet#create} */ readonly create?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#delete Ec2Fleet#delete} */ readonly delete?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html#update Ec2Fleet#update} */ readonly update?: string; } export function ec2FleetTimeoutsToTerraform(struct?: Ec2FleetTimeoutsOutputReference | Ec2FleetTimeouts): 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 { create: cdktf.stringToTerraform(struct!.create), delete: cdktf.stringToTerraform(struct!.delete), update: cdktf.stringToTerraform(struct!.update), } } export class Ec2FleetTimeoutsOutputReference 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(): Ec2FleetTimeouts | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._create !== undefined) { hasAnyValues = true; internalValueResult.create = this._create; } if (this._delete !== undefined) { hasAnyValues = true; internalValueResult.delete = this._delete; } if (this._update !== undefined) { hasAnyValues = true; internalValueResult.update = this._update; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: Ec2FleetTimeouts | undefined) { if (value === undefined) { this.isEmptyObject = false; this._create = undefined; this._delete = undefined; this._update = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._create = value.create; this._delete = value.delete; this._update = value.update; } } // create - computed: false, optional: true, required: false private _create?: string; public get create() { return this.getStringAttribute('create'); } public set create(value: string) { this._create = value; } public resetCreate() { this._create = undefined; } // Temporarily expose input value. Use with caution. public get createInput() { return this._create; } // delete - computed: false, optional: true, required: false private _delete?: string; public get delete() { return this.getStringAttribute('delete'); } public set delete(value: string) { this._delete = value; } public resetDelete() { this._delete = undefined; } // Temporarily expose input value. Use with caution. public get deleteInput() { return this._delete; } // update - computed: false, optional: true, required: false private _update?: string; public get update() { return this.getStringAttribute('update'); } public set update(value: string) { this._update = value; } public resetUpdate() { this._update = undefined; } // Temporarily expose input value. Use with caution. public get updateInput() { return this._update; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html aws_ec2_fleet} */ export class Ec2Fleet extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_ec2_fleet"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html aws_ec2_fleet} 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 Ec2FleetConfig */ public constructor(scope: Construct, id: string, config: Ec2FleetConfig) { super(scope, id, { terraformResourceType: 'aws_ec2_fleet', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._excessCapacityTerminationPolicy = config.excessCapacityTerminationPolicy; this._replaceUnhealthyInstances = config.replaceUnhealthyInstances; this._tags = config.tags; this._tagsAll = config.tagsAll; this._terminateInstances = config.terminateInstances; this._terminateInstancesWithExpiration = config.terminateInstancesWithExpiration; this._type = config.type; this._launchTemplateConfig.internalValue = config.launchTemplateConfig; this._onDemandOptions.internalValue = config.onDemandOptions; this._spotOptions.internalValue = config.spotOptions; this._targetCapacitySpecification.internalValue = config.targetCapacitySpecification; this._timeouts.internalValue = config.timeouts; } // ========== // ATTRIBUTES // ========== // excess_capacity_termination_policy - computed: false, optional: true, required: false private _excessCapacityTerminationPolicy?: string; public get excessCapacityTerminationPolicy() { return this.getStringAttribute('excess_capacity_termination_policy'); } public set excessCapacityTerminationPolicy(value: string) { this._excessCapacityTerminationPolicy = value; } public resetExcessCapacityTerminationPolicy() { this._excessCapacityTerminationPolicy = undefined; } // Temporarily expose input value. Use with caution. public get excessCapacityTerminationPolicyInput() { return this._excessCapacityTerminationPolicy; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // replace_unhealthy_instances - computed: false, optional: true, required: false private _replaceUnhealthyInstances?: boolean | cdktf.IResolvable; public get replaceUnhealthyInstances() { return this.getBooleanAttribute('replace_unhealthy_instances') as any; } public set replaceUnhealthyInstances(value: boolean | cdktf.IResolvable) { this._replaceUnhealthyInstances = value; } public resetReplaceUnhealthyInstances() { this._replaceUnhealthyInstances = undefined; } // Temporarily expose input value. Use with caution. public get replaceUnhealthyInstancesInput() { return this._replaceUnhealthyInstances; } // tags - computed: false, optional: true, required: false private _tags?: { [key: string]: string } | cdktf.IResolvable; public get tags() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags') as any; } public set tags(value: { [key: string]: string } | cdktf.IResolvable) { this._tags = value; } public resetTags() { this._tags = undefined; } // Temporarily expose input value. Use with caution. public get tagsInput() { return this._tags; } // tags_all - computed: true, optional: true, required: false private _tagsAll?: { [key: string]: string } | cdktf.IResolvable; public get tagsAll() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags_all') as any; } public set tagsAll(value: { [key: string]: string } | cdktf.IResolvable) { this._tagsAll = value; } public resetTagsAll() { this._tagsAll = undefined; } // Temporarily expose input value. Use with caution. public get tagsAllInput() { return this._tagsAll; } // terminate_instances - computed: false, optional: true, required: false private _terminateInstances?: boolean | cdktf.IResolvable; public get terminateInstances() { return this.getBooleanAttribute('terminate_instances') as any; } public set terminateInstances(value: boolean | cdktf.IResolvable) { this._terminateInstances = value; } public resetTerminateInstances() { this._terminateInstances = undefined; } // Temporarily expose input value. Use with caution. public get terminateInstancesInput() { return this._terminateInstances; } // terminate_instances_with_expiration - computed: false, optional: true, required: false private _terminateInstancesWithExpiration?: boolean | cdktf.IResolvable; public get terminateInstancesWithExpiration() { return this.getBooleanAttribute('terminate_instances_with_expiration') as any; } public set terminateInstancesWithExpiration(value: boolean | cdktf.IResolvable) { this._terminateInstancesWithExpiration = value; } public resetTerminateInstancesWithExpiration() { this._terminateInstancesWithExpiration = undefined; } // Temporarily expose input value. Use with caution. public get terminateInstancesWithExpirationInput() { return this._terminateInstancesWithExpiration; } // 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; } // launch_template_config - computed: false, optional: false, required: true private _launchTemplateConfig = new Ec2FleetLaunchTemplateConfigOutputReference(this as any, "launch_template_config", true); public get launchTemplateConfig() { return this._launchTemplateConfig; } public putLaunchTemplateConfig(value: Ec2FleetLaunchTemplateConfig) { this._launchTemplateConfig.internalValue = value; } // Temporarily expose input value. Use with caution. public get launchTemplateConfigInput() { return this._launchTemplateConfig.internalValue; } // on_demand_options - computed: false, optional: true, required: false private _onDemandOptions = new Ec2FleetOnDemandOptionsOutputReference(this as any, "on_demand_options", true); public get onDemandOptions() { return this._onDemandOptions; } public putOnDemandOptions(value: Ec2FleetOnDemandOptions) { this._onDemandOptions.internalValue = value; } public resetOnDemandOptions() { this._onDemandOptions.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get onDemandOptionsInput() { return this._onDemandOptions.internalValue; } // spot_options - computed: false, optional: true, required: false private _spotOptions = new Ec2FleetSpotOptionsOutputReference(this as any, "spot_options", true); public get spotOptions() { return this._spotOptions; } public putSpotOptions(value: Ec2FleetSpotOptions) { this._spotOptions.internalValue = value; } public resetSpotOptions() { this._spotOptions.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get spotOptionsInput() { return this._spotOptions.internalValue; } // target_capacity_specification - computed: false, optional: false, required: true private _targetCapacitySpecification = new Ec2FleetTargetCapacitySpecificationOutputReference(this as any, "target_capacity_specification", true); public get targetCapacitySpecification() { return this._targetCapacitySpecification; } public putTargetCapacitySpecification(value: Ec2FleetTargetCapacitySpecification) { this._targetCapacitySpecification.internalValue = value; } // Temporarily expose input value. Use with caution. public get targetCapacitySpecificationInput() { return this._targetCapacitySpecification.internalValue; } // timeouts - computed: false, optional: true, required: false private _timeouts = new Ec2FleetTimeoutsOutputReference(this as any, "timeouts", true); public get timeouts() { return this._timeouts; } public putTimeouts(value: Ec2FleetTimeouts) { this._timeouts.internalValue = value; } public resetTimeouts() { this._timeouts.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get timeoutsInput() { return this._timeouts.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { excess_capacity_termination_policy: cdktf.stringToTerraform(this._excessCapacityTerminationPolicy), replace_unhealthy_instances: cdktf.booleanToTerraform(this._replaceUnhealthyInstances), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), terminate_instances: cdktf.booleanToTerraform(this._terminateInstances), terminate_instances_with_expiration: cdktf.booleanToTerraform(this._terminateInstancesWithExpiration), type: cdktf.stringToTerraform(this._type), launch_template_config: ec2FleetLaunchTemplateConfigToTerraform(this._launchTemplateConfig.internalValue), on_demand_options: ec2FleetOnDemandOptionsToTerraform(this._onDemandOptions.internalValue), spot_options: ec2FleetSpotOptionsToTerraform(this._spotOptions.internalValue), target_capacity_specification: ec2FleetTargetCapacitySpecificationToTerraform(this._targetCapacitySpecification.internalValue), timeouts: ec2FleetTimeoutsToTerraform(this._timeouts.internalValue), }; } }