// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS CodeStar */ export interface CodestarconnectionsHostConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codestarconnections_host.html#name CodestarconnectionsHost#name} */ readonly name: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codestarconnections_host.html#provider_endpoint CodestarconnectionsHost#provider_endpoint} */ readonly providerEndpoint: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codestarconnections_host.html#provider_type CodestarconnectionsHost#provider_type} */ readonly providerType: string; /** * vpc_configuration block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codestarconnections_host.html#vpc_configuration CodestarconnectionsHost#vpc_configuration} */ readonly vpcConfiguration?: CodestarconnectionsHostVpcConfiguration; } export interface CodestarconnectionsHostVpcConfiguration { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codestarconnections_host.html#security_group_ids CodestarconnectionsHost#security_group_ids} */ readonly securityGroupIds: string[]; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codestarconnections_host.html#subnet_ids CodestarconnectionsHost#subnet_ids} */ readonly subnetIds: string[]; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codestarconnections_host.html#tls_certificate CodestarconnectionsHost#tls_certificate} */ readonly tlsCertificate?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/codestarconnections_host.html#vpc_id CodestarconnectionsHost#vpc_id} */ readonly vpcId: string; } export function codestarconnectionsHostVpcConfigurationToTerraform(struct?: CodestarconnectionsHostVpcConfigurationOutputReference | CodestarconnectionsHostVpcConfiguration): 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 { security_group_ids: cdktf.listMapper(cdktf.stringToTerraform)(struct!.securityGroupIds), subnet_ids: cdktf.listMapper(cdktf.stringToTerraform)(struct!.subnetIds), tls_certificate: cdktf.stringToTerraform(struct!.tlsCertificate), vpc_id: cdktf.stringToTerraform(struct!.vpcId), } } export class CodestarconnectionsHostVpcConfigurationOutputReference 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(): CodestarconnectionsHostVpcConfiguration | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._securityGroupIds !== undefined) { hasAnyValues = true; internalValueResult.securityGroupIds = this._securityGroupIds; } if (this._subnetIds !== undefined) { hasAnyValues = true; internalValueResult.subnetIds = this._subnetIds; } if (this._tlsCertificate !== undefined) { hasAnyValues = true; internalValueResult.tlsCertificate = this._tlsCertificate; } if (this._vpcId !== undefined) { hasAnyValues = true; internalValueResult.vpcId = this._vpcId; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: CodestarconnectionsHostVpcConfiguration | undefined) { if (value === undefined) { this.isEmptyObject = false; this._securityGroupIds = undefined; this._subnetIds = undefined; this._tlsCertificate = undefined; this._vpcId = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._securityGroupIds = value.securityGroupIds; this._subnetIds = value.subnetIds; this._tlsCertificate = value.tlsCertificate; this._vpcId = value.vpcId; } } // security_group_ids - computed: false, optional: false, required: true private _securityGroupIds?: string[]; public get securityGroupIds() { return this.getListAttribute('security_group_ids'); } public set securityGroupIds(value: string[]) { this._securityGroupIds = value; } // Temporarily expose input value. Use with caution. public get securityGroupIdsInput() { return this._securityGroupIds; } // subnet_ids - computed: false, optional: false, required: true private _subnetIds?: string[]; public get subnetIds() { return this.getListAttribute('subnet_ids'); } public set subnetIds(value: string[]) { this._subnetIds = value; } // Temporarily expose input value. Use with caution. public get subnetIdsInput() { return this._subnetIds; } // tls_certificate - computed: false, optional: true, required: false private _tlsCertificate?: string; public get tlsCertificate() { return this.getStringAttribute('tls_certificate'); } public set tlsCertificate(value: string) { this._tlsCertificate = value; } public resetTlsCertificate() { this._tlsCertificate = undefined; } // Temporarily expose input value. Use with caution. public get tlsCertificateInput() { return this._tlsCertificate; } // vpc_id - computed: false, optional: false, required: true private _vpcId?: string; public get vpcId() { return this.getStringAttribute('vpc_id'); } public set vpcId(value: string) { this._vpcId = value; } // Temporarily expose input value. Use with caution. public get vpcIdInput() { return this._vpcId; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/codestarconnections_host.html aws_codestarconnections_host} */ export class CodestarconnectionsHost extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_codestarconnections_host"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/codestarconnections_host.html aws_codestarconnections_host} 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 CodestarconnectionsHostConfig */ public constructor(scope: Construct, id: string, config: CodestarconnectionsHostConfig) { super(scope, id, { terraformResourceType: 'aws_codestarconnections_host', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._name = config.name; this._providerEndpoint = config.providerEndpoint; this._providerType = config.providerType; this._vpcConfiguration.internalValue = config.vpcConfiguration; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // name - computed: false, optional: false, required: true private _name?: string; public get name() { return this.getStringAttribute('name'); } public set name(value: string) { this._name = value; } // Temporarily expose input value. Use with caution. public get nameInput() { return this._name; } // provider_endpoint - computed: false, optional: false, required: true private _providerEndpoint?: string; public get providerEndpoint() { return this.getStringAttribute('provider_endpoint'); } public set providerEndpoint(value: string) { this._providerEndpoint = value; } // Temporarily expose input value. Use with caution. public get providerEndpointInput() { return this._providerEndpoint; } // provider_type - computed: false, optional: false, required: true private _providerType?: string; public get providerType() { return this.getStringAttribute('provider_type'); } public set providerType(value: string) { this._providerType = value; } // Temporarily expose input value. Use with caution. public get providerTypeInput() { return this._providerType; } // status - computed: true, optional: false, required: false public get status() { return this.getStringAttribute('status'); } // vpc_configuration - computed: false, optional: true, required: false private _vpcConfiguration = new CodestarconnectionsHostVpcConfigurationOutputReference(this as any, "vpc_configuration", true); public get vpcConfiguration() { return this._vpcConfiguration; } public putVpcConfiguration(value: CodestarconnectionsHostVpcConfiguration) { this._vpcConfiguration.internalValue = value; } public resetVpcConfiguration() { this._vpcConfiguration.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get vpcConfigurationInput() { return this._vpcConfiguration.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { name: cdktf.stringToTerraform(this._name), provider_endpoint: cdktf.stringToTerraform(this._providerEndpoint), provider_type: cdktf.stringToTerraform(this._providerType), vpc_configuration: codestarconnectionsHostVpcConfigurationToTerraform(this._vpcConfiguration.internalValue), }; } }