// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS GameLift */ export interface GameliftAliasConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/gamelift_alias.html#description GameliftAlias#description} */ readonly description?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/gamelift_alias.html#name GameliftAlias#name} */ readonly name: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/gamelift_alias.html#tags GameliftAlias#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/gamelift_alias.html#tags_all GameliftAlias#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * routing_strategy block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/gamelift_alias.html#routing_strategy GameliftAlias#routing_strategy} */ readonly routingStrategy: GameliftAliasRoutingStrategy; } export interface GameliftAliasRoutingStrategy { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/gamelift_alias.html#fleet_id GameliftAlias#fleet_id} */ readonly fleetId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/gamelift_alias.html#message GameliftAlias#message} */ readonly message?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/gamelift_alias.html#type GameliftAlias#type} */ readonly type: string; } export function gameliftAliasRoutingStrategyToTerraform(struct?: GameliftAliasRoutingStrategyOutputReference | GameliftAliasRoutingStrategy): 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 { fleet_id: cdktf.stringToTerraform(struct!.fleetId), message: cdktf.stringToTerraform(struct!.message), type: cdktf.stringToTerraform(struct!.type), } } export class GameliftAliasRoutingStrategyOutputReference 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(): GameliftAliasRoutingStrategy | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._fleetId !== undefined) { hasAnyValues = true; internalValueResult.fleetId = this._fleetId; } if (this._message !== undefined) { hasAnyValues = true; internalValueResult.message = this._message; } if (this._type !== undefined) { hasAnyValues = true; internalValueResult.type = this._type; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: GameliftAliasRoutingStrategy | undefined) { if (value === undefined) { this.isEmptyObject = false; this._fleetId = undefined; this._message = undefined; this._type = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._fleetId = value.fleetId; this._message = value.message; this._type = value.type; } } // fleet_id - computed: false, optional: true, required: false private _fleetId?: string; public get fleetId() { return this.getStringAttribute('fleet_id'); } public set fleetId(value: string) { this._fleetId = value; } public resetFleetId() { this._fleetId = undefined; } // Temporarily expose input value. Use with caution. public get fleetIdInput() { return this._fleetId; } // message - computed: false, optional: true, required: false private _message?: string; public get message() { return this.getStringAttribute('message'); } public set message(value: string) { this._message = value; } public resetMessage() { this._message = undefined; } // Temporarily expose input value. Use with caution. public get messageInput() { return this._message; } // type - computed: false, optional: false, required: true private _type?: string; public get type() { return this.getStringAttribute('type'); } public set type(value: string) { this._type = value; } // Temporarily expose input value. Use with caution. public get typeInput() { return this._type; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/gamelift_alias.html aws_gamelift_alias} */ export class GameliftAlias extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_gamelift_alias"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/gamelift_alias.html aws_gamelift_alias} 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 GameliftAliasConfig */ public constructor(scope: Construct, id: string, config: GameliftAliasConfig) { super(scope, id, { terraformResourceType: 'aws_gamelift_alias', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._description = config.description; this._name = config.name; this._tags = config.tags; this._tagsAll = config.tagsAll; this._routingStrategy.internalValue = config.routingStrategy; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // description - computed: false, optional: true, required: false private _description?: string; public get description() { return this.getStringAttribute('description'); } public set description(value: string) { this._description = value; } public resetDescription() { this._description = undefined; } // Temporarily expose input value. Use with caution. public get descriptionInput() { return this._description; } // 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; } // 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; } // routing_strategy - computed: false, optional: false, required: true private _routingStrategy = new GameliftAliasRoutingStrategyOutputReference(this as any, "routing_strategy", true); public get routingStrategy() { return this._routingStrategy; } public putRoutingStrategy(value: GameliftAliasRoutingStrategy) { this._routingStrategy.internalValue = value; } // Temporarily expose input value. Use with caution. public get routingStrategyInput() { return this._routingStrategy.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { description: cdktf.stringToTerraform(this._description), name: cdktf.stringToTerraform(this._name), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), routing_strategy: gameliftAliasRoutingStrategyToTerraform(this._routingStrategy.internalValue), }; } }