// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS EC2 */ export interface DataAwsEc2HostConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/ec2_host.html#host_id DataAwsEc2Host#host_id} */ readonly hostId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/ec2_host.html#tags DataAwsEc2Host#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * filter block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/ec2_host.html#filter DataAwsEc2Host#filter} */ readonly filter?: DataAwsEc2HostFilter[]; } export interface DataAwsEc2HostFilter { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/ec2_host.html#name DataAwsEc2Host#name} */ readonly name: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/ec2_host.html#values DataAwsEc2Host#values} */ readonly values: string[]; } export function dataAwsEc2HostFilterToTerraform(struct?: DataAwsEc2HostFilter): 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 { name: cdktf.stringToTerraform(struct!.name), values: cdktf.listMapper(cdktf.stringToTerraform)(struct!.values), } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/d/ec2_host.html aws_ec2_host} */ export class DataAwsEc2Host extends cdktf.TerraformDataSource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_ec2_host"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/d/ec2_host.html aws_ec2_host} Data Source * * @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 DataAwsEc2HostConfig = {} */ public constructor(scope: Construct, id: string, config: DataAwsEc2HostConfig = {}) { super(scope, id, { terraformResourceType: 'aws_ec2_host', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._hostId = config.hostId; this._tags = config.tags; this._filter = config.filter; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // auto_placement - computed: true, optional: false, required: false public get autoPlacement() { return this.getStringAttribute('auto_placement'); } // availability_zone - computed: true, optional: false, required: false public get availabilityZone() { return this.getStringAttribute('availability_zone'); } // cores - computed: true, optional: false, required: false public get cores() { return this.getNumberAttribute('cores'); } // host_id - computed: true, optional: true, required: false private _hostId?: string; public get hostId() { return this.getStringAttribute('host_id'); } public set hostId(value: string) { this._hostId = value; } public resetHostId() { this._hostId = undefined; } // Temporarily expose input value. Use with caution. public get hostIdInput() { return this._hostId; } // host_recovery - computed: true, optional: false, required: false public get hostRecovery() { return this.getStringAttribute('host_recovery'); } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // instance_family - computed: true, optional: false, required: false public get instanceFamily() { return this.getStringAttribute('instance_family'); } // instance_type - computed: true, optional: false, required: false public get instanceType() { return this.getStringAttribute('instance_type'); } // owner_id - computed: true, optional: false, required: false public get ownerId() { return this.getStringAttribute('owner_id'); } // sockets - computed: true, optional: false, required: false public get sockets() { return this.getNumberAttribute('sockets'); } // tags - computed: true, 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; } // total_vcpus - computed: true, optional: false, required: false public get totalVcpus() { return this.getNumberAttribute('total_vcpus'); } // filter - computed: false, optional: true, required: false private _filter?: DataAwsEc2HostFilter[]; public get filter() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('filter') as any; } public set filter(value: DataAwsEc2HostFilter[]) { this._filter = value; } public resetFilter() { this._filter = undefined; } // Temporarily expose input value. Use with caution. public get filterInput() { return this._filter; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { host_id: cdktf.stringToTerraform(this._hostId), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), filter: cdktf.listMapper(dataAwsEc2HostFilterToTerraform)(this._filter), }; } }