// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS Transfer */ export interface TransferAccessConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#external_id TransferAccess#external_id} */ readonly externalId: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#home_directory TransferAccess#home_directory} */ readonly homeDirectory?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#home_directory_type TransferAccess#home_directory_type} */ readonly homeDirectoryType?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#policy TransferAccess#policy} */ readonly policy?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#role TransferAccess#role} */ readonly role?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#server_id TransferAccess#server_id} */ readonly serverId: string; /** * home_directory_mappings block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#home_directory_mappings TransferAccess#home_directory_mappings} */ readonly homeDirectoryMappings?: TransferAccessHomeDirectoryMappings[]; /** * posix_profile block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#posix_profile TransferAccess#posix_profile} */ readonly posixProfile?: TransferAccessPosixProfile; } export interface TransferAccessHomeDirectoryMappings { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#entry TransferAccess#entry} */ readonly entry: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#target TransferAccess#target} */ readonly target: string; } export function transferAccessHomeDirectoryMappingsToTerraform(struct?: TransferAccessHomeDirectoryMappings): 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 { entry: cdktf.stringToTerraform(struct!.entry), target: cdktf.stringToTerraform(struct!.target), } } export interface TransferAccessPosixProfile { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#gid TransferAccess#gid} */ readonly gid: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#secondary_gids TransferAccess#secondary_gids} */ readonly secondaryGids?: number[]; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html#uid TransferAccess#uid} */ readonly uid: number; } export function transferAccessPosixProfileToTerraform(struct?: TransferAccessPosixProfileOutputReference | TransferAccessPosixProfile): 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 { gid: cdktf.numberToTerraform(struct!.gid), secondary_gids: cdktf.listMapper(cdktf.numberToTerraform)(struct!.secondaryGids), uid: cdktf.numberToTerraform(struct!.uid), } } export class TransferAccessPosixProfileOutputReference 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(): TransferAccessPosixProfile | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._gid !== undefined) { hasAnyValues = true; internalValueResult.gid = this._gid; } if (this._secondaryGids !== undefined) { hasAnyValues = true; internalValueResult.secondaryGids = this._secondaryGids; } if (this._uid !== undefined) { hasAnyValues = true; internalValueResult.uid = this._uid; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: TransferAccessPosixProfile | undefined) { if (value === undefined) { this.isEmptyObject = false; this._gid = undefined; this._secondaryGids = undefined; this._uid = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._gid = value.gid; this._secondaryGids = value.secondaryGids; this._uid = value.uid; } } // gid - computed: false, optional: false, required: true private _gid?: number; public get gid() { return this.getNumberAttribute('gid'); } public set gid(value: number) { this._gid = value; } // Temporarily expose input value. Use with caution. public get gidInput() { return this._gid; } // secondary_gids - computed: false, optional: true, required: false private _secondaryGids?: number[]; public get secondaryGids() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('secondary_gids') as any; } public set secondaryGids(value: number[]) { this._secondaryGids = value; } public resetSecondaryGids() { this._secondaryGids = undefined; } // Temporarily expose input value. Use with caution. public get secondaryGidsInput() { return this._secondaryGids; } // uid - computed: false, optional: false, required: true private _uid?: number; public get uid() { return this.getNumberAttribute('uid'); } public set uid(value: number) { this._uid = value; } // Temporarily expose input value. Use with caution. public get uidInput() { return this._uid; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html aws_transfer_access} */ export class TransferAccess extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_transfer_access"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/transfer_access.html aws_transfer_access} 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 TransferAccessConfig */ public constructor(scope: Construct, id: string, config: TransferAccessConfig) { super(scope, id, { terraformResourceType: 'aws_transfer_access', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._externalId = config.externalId; this._homeDirectory = config.homeDirectory; this._homeDirectoryType = config.homeDirectoryType; this._policy = config.policy; this._role = config.role; this._serverId = config.serverId; this._homeDirectoryMappings = config.homeDirectoryMappings; this._posixProfile.internalValue = config.posixProfile; } // ========== // ATTRIBUTES // ========== // external_id - computed: false, optional: false, required: true private _externalId?: string; public get externalId() { return this.getStringAttribute('external_id'); } public set externalId(value: string) { this._externalId = value; } // Temporarily expose input value. Use with caution. public get externalIdInput() { return this._externalId; } // home_directory - computed: false, optional: true, required: false private _homeDirectory?: string; public get homeDirectory() { return this.getStringAttribute('home_directory'); } public set homeDirectory(value: string) { this._homeDirectory = value; } public resetHomeDirectory() { this._homeDirectory = undefined; } // Temporarily expose input value. Use with caution. public get homeDirectoryInput() { return this._homeDirectory; } // home_directory_type - computed: false, optional: true, required: false private _homeDirectoryType?: string; public get homeDirectoryType() { return this.getStringAttribute('home_directory_type'); } public set homeDirectoryType(value: string) { this._homeDirectoryType = value; } public resetHomeDirectoryType() { this._homeDirectoryType = undefined; } // Temporarily expose input value. Use with caution. public get homeDirectoryTypeInput() { return this._homeDirectoryType; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // policy - computed: false, optional: true, required: false private _policy?: string; public get policy() { return this.getStringAttribute('policy'); } public set policy(value: string) { this._policy = value; } public resetPolicy() { this._policy = undefined; } // Temporarily expose input value. Use with caution. public get policyInput() { return this._policy; } // role - computed: false, optional: true, required: false private _role?: string; public get role() { return this.getStringAttribute('role'); } public set role(value: string) { this._role = value; } public resetRole() { this._role = undefined; } // Temporarily expose input value. Use with caution. public get roleInput() { return this._role; } // server_id - computed: false, optional: false, required: true private _serverId?: string; public get serverId() { return this.getStringAttribute('server_id'); } public set serverId(value: string) { this._serverId = value; } // Temporarily expose input value. Use with caution. public get serverIdInput() { return this._serverId; } // home_directory_mappings - computed: false, optional: true, required: false private _homeDirectoryMappings?: TransferAccessHomeDirectoryMappings[]; public get homeDirectoryMappings() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('home_directory_mappings') as any; } public set homeDirectoryMappings(value: TransferAccessHomeDirectoryMappings[]) { this._homeDirectoryMappings = value; } public resetHomeDirectoryMappings() { this._homeDirectoryMappings = undefined; } // Temporarily expose input value. Use with caution. public get homeDirectoryMappingsInput() { return this._homeDirectoryMappings; } // posix_profile - computed: false, optional: true, required: false private _posixProfile = new TransferAccessPosixProfileOutputReference(this as any, "posix_profile", true); public get posixProfile() { return this._posixProfile; } public putPosixProfile(value: TransferAccessPosixProfile) { this._posixProfile.internalValue = value; } public resetPosixProfile() { this._posixProfile.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get posixProfileInput() { return this._posixProfile.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { external_id: cdktf.stringToTerraform(this._externalId), home_directory: cdktf.stringToTerraform(this._homeDirectory), home_directory_type: cdktf.stringToTerraform(this._homeDirectoryType), policy: cdktf.stringToTerraform(this._policy), role: cdktf.stringToTerraform(this._role), server_id: cdktf.stringToTerraform(this._serverId), home_directory_mappings: cdktf.listMapper(transferAccessHomeDirectoryMappingsToTerraform)(this._homeDirectoryMappings), posix_profile: transferAccessPosixProfileToTerraform(this._posixProfile.internalValue), }; } }