// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * App Mesh */ export interface AppmeshMeshConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/appmesh_mesh.html#name AppmeshMesh#name} */ readonly name: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/appmesh_mesh.html#tags AppmeshMesh#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/appmesh_mesh.html#tags_all AppmeshMesh#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * spec block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/appmesh_mesh.html#spec AppmeshMesh#spec} */ readonly spec?: AppmeshMeshSpec; } export interface AppmeshMeshSpecEgressFilter { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/appmesh_mesh.html#type AppmeshMesh#type} */ readonly type?: string; } export function appmeshMeshSpecEgressFilterToTerraform(struct?: AppmeshMeshSpecEgressFilterOutputReference | AppmeshMeshSpecEgressFilter): 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), } } export class AppmeshMeshSpecEgressFilterOutputReference 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(): AppmeshMeshSpecEgressFilter | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._type !== undefined) { hasAnyValues = true; internalValueResult.type = this._type; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: AppmeshMeshSpecEgressFilter | undefined) { if (value === undefined) { this.isEmptyObject = false; this._type = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._type = value.type; } } // 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; } } export interface AppmeshMeshSpec { /** * egress_filter block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/appmesh_mesh.html#egress_filter AppmeshMesh#egress_filter} */ readonly egressFilter?: AppmeshMeshSpecEgressFilter; } export function appmeshMeshSpecToTerraform(struct?: AppmeshMeshSpecOutputReference | AppmeshMeshSpec): 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 { egress_filter: appmeshMeshSpecEgressFilterToTerraform(struct!.egressFilter), } } export class AppmeshMeshSpecOutputReference 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(): AppmeshMeshSpec | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._egressFilter?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.egressFilter = this._egressFilter?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: AppmeshMeshSpec | undefined) { if (value === undefined) { this.isEmptyObject = false; this._egressFilter.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._egressFilter.internalValue = value.egressFilter; } } // egress_filter - computed: false, optional: true, required: false private _egressFilter = new AppmeshMeshSpecEgressFilterOutputReference(this as any, "egress_filter", true); public get egressFilter() { return this._egressFilter; } public putEgressFilter(value: AppmeshMeshSpecEgressFilter) { this._egressFilter.internalValue = value; } public resetEgressFilter() { this._egressFilter.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get egressFilterInput() { return this._egressFilter.internalValue; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/appmesh_mesh.html aws_appmesh_mesh} */ export class AppmeshMesh extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_appmesh_mesh"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/appmesh_mesh.html aws_appmesh_mesh} 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 AppmeshMeshConfig */ public constructor(scope: Construct, id: string, config: AppmeshMeshConfig) { super(scope, id, { terraformResourceType: 'aws_appmesh_mesh', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._name = config.name; this._tags = config.tags; this._tagsAll = config.tagsAll; this._spec.internalValue = config.spec; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // created_date - computed: true, optional: false, required: false public get createdDate() { return this.getStringAttribute('created_date'); } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // last_updated_date - computed: true, optional: false, required: false public get lastUpdatedDate() { return this.getStringAttribute('last_updated_date'); } // mesh_owner - computed: true, optional: false, required: false public get meshOwner() { return this.getStringAttribute('mesh_owner'); } // 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; } // resource_owner - computed: true, optional: false, required: false public get resourceOwner() { return this.getStringAttribute('resource_owner'); } // 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; } // spec - computed: false, optional: true, required: false private _spec = new AppmeshMeshSpecOutputReference(this as any, "spec", true); public get spec() { return this._spec; } public putSpec(value: AppmeshMeshSpec) { this._spec.internalValue = value; } public resetSpec() { this._spec.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get specInput() { return this._spec.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { name: cdktf.stringToTerraform(this._name), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), spec: appmeshMeshSpecToTerraform(this._spec.internalValue), }; } }