// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS EFS */ export interface EfsAccessPointConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#file_system_id EfsAccessPoint#file_system_id} */ readonly fileSystemId: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#tags EfsAccessPoint#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#tags_all EfsAccessPoint#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * posix_user block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#posix_user EfsAccessPoint#posix_user} */ readonly posixUser?: EfsAccessPointPosixUser; /** * root_directory block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#root_directory EfsAccessPoint#root_directory} */ readonly rootDirectory?: EfsAccessPointRootDirectory; } export interface EfsAccessPointPosixUser { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#gid EfsAccessPoint#gid} */ readonly gid: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#secondary_gids EfsAccessPoint#secondary_gids} */ readonly secondaryGids?: number[]; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#uid EfsAccessPoint#uid} */ readonly uid: number; } export function efsAccessPointPosixUserToTerraform(struct?: EfsAccessPointPosixUserOutputReference | EfsAccessPointPosixUser): 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 EfsAccessPointPosixUserOutputReference 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(): EfsAccessPointPosixUser | 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: EfsAccessPointPosixUser | 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; } } export interface EfsAccessPointRootDirectoryCreationInfo { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#owner_gid EfsAccessPoint#owner_gid} */ readonly ownerGid: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#owner_uid EfsAccessPoint#owner_uid} */ readonly ownerUid: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#permissions EfsAccessPoint#permissions} */ readonly permissions: string; } export function efsAccessPointRootDirectoryCreationInfoToTerraform(struct?: EfsAccessPointRootDirectoryCreationInfoOutputReference | EfsAccessPointRootDirectoryCreationInfo): 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 { owner_gid: cdktf.numberToTerraform(struct!.ownerGid), owner_uid: cdktf.numberToTerraform(struct!.ownerUid), permissions: cdktf.stringToTerraform(struct!.permissions), } } export class EfsAccessPointRootDirectoryCreationInfoOutputReference 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(): EfsAccessPointRootDirectoryCreationInfo | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._ownerGid !== undefined) { hasAnyValues = true; internalValueResult.ownerGid = this._ownerGid; } if (this._ownerUid !== undefined) { hasAnyValues = true; internalValueResult.ownerUid = this._ownerUid; } if (this._permissions !== undefined) { hasAnyValues = true; internalValueResult.permissions = this._permissions; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: EfsAccessPointRootDirectoryCreationInfo | undefined) { if (value === undefined) { this.isEmptyObject = false; this._ownerGid = undefined; this._ownerUid = undefined; this._permissions = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._ownerGid = value.ownerGid; this._ownerUid = value.ownerUid; this._permissions = value.permissions; } } // owner_gid - computed: false, optional: false, required: true private _ownerGid?: number; public get ownerGid() { return this.getNumberAttribute('owner_gid'); } public set ownerGid(value: number) { this._ownerGid = value; } // Temporarily expose input value. Use with caution. public get ownerGidInput() { return this._ownerGid; } // owner_uid - computed: false, optional: false, required: true private _ownerUid?: number; public get ownerUid() { return this.getNumberAttribute('owner_uid'); } public set ownerUid(value: number) { this._ownerUid = value; } // Temporarily expose input value. Use with caution. public get ownerUidInput() { return this._ownerUid; } // permissions - computed: false, optional: false, required: true private _permissions?: string; public get permissions() { return this.getStringAttribute('permissions'); } public set permissions(value: string) { this._permissions = value; } // Temporarily expose input value. Use with caution. public get permissionsInput() { return this._permissions; } } export interface EfsAccessPointRootDirectory { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#path EfsAccessPoint#path} */ readonly path?: string; /** * creation_info block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html#creation_info EfsAccessPoint#creation_info} */ readonly creationInfo?: EfsAccessPointRootDirectoryCreationInfo; } export function efsAccessPointRootDirectoryToTerraform(struct?: EfsAccessPointRootDirectoryOutputReference | EfsAccessPointRootDirectory): 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 { path: cdktf.stringToTerraform(struct!.path), creation_info: efsAccessPointRootDirectoryCreationInfoToTerraform(struct!.creationInfo), } } export class EfsAccessPointRootDirectoryOutputReference 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(): EfsAccessPointRootDirectory | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._path !== undefined) { hasAnyValues = true; internalValueResult.path = this._path; } if (this._creationInfo?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.creationInfo = this._creationInfo?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: EfsAccessPointRootDirectory | undefined) { if (value === undefined) { this.isEmptyObject = false; this._path = undefined; this._creationInfo.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._path = value.path; this._creationInfo.internalValue = value.creationInfo; } } // path - computed: true, optional: true, required: false private _path?: string; public get path() { return this.getStringAttribute('path'); } public set path(value: string) { this._path = value; } public resetPath() { this._path = undefined; } // Temporarily expose input value. Use with caution. public get pathInput() { return this._path; } // creation_info - computed: false, optional: true, required: false private _creationInfo = new EfsAccessPointRootDirectoryCreationInfoOutputReference(this as any, "creation_info", true); public get creationInfo() { return this._creationInfo; } public putCreationInfo(value: EfsAccessPointRootDirectoryCreationInfo) { this._creationInfo.internalValue = value; } public resetCreationInfo() { this._creationInfo.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get creationInfoInput() { return this._creationInfo.internalValue; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html aws_efs_access_point} */ export class EfsAccessPoint extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_efs_access_point"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point.html aws_efs_access_point} 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 EfsAccessPointConfig */ public constructor(scope: Construct, id: string, config: EfsAccessPointConfig) { super(scope, id, { terraformResourceType: 'aws_efs_access_point', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._fileSystemId = config.fileSystemId; this._tags = config.tags; this._tagsAll = config.tagsAll; this._posixUser.internalValue = config.posixUser; this._rootDirectory.internalValue = config.rootDirectory; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // file_system_arn - computed: true, optional: false, required: false public get fileSystemArn() { return this.getStringAttribute('file_system_arn'); } // file_system_id - computed: false, optional: false, required: true private _fileSystemId?: string; public get fileSystemId() { return this.getStringAttribute('file_system_id'); } public set fileSystemId(value: string) { this._fileSystemId = value; } // Temporarily expose input value. Use with caution. public get fileSystemIdInput() { return this._fileSystemId; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // owner_id - computed: true, optional: false, required: false public get ownerId() { return this.getStringAttribute('owner_id'); } // 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; } // posix_user - computed: false, optional: true, required: false private _posixUser = new EfsAccessPointPosixUserOutputReference(this as any, "posix_user", true); public get posixUser() { return this._posixUser; } public putPosixUser(value: EfsAccessPointPosixUser) { this._posixUser.internalValue = value; } public resetPosixUser() { this._posixUser.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get posixUserInput() { return this._posixUser.internalValue; } // root_directory - computed: false, optional: true, required: false private _rootDirectory = new EfsAccessPointRootDirectoryOutputReference(this as any, "root_directory", true); public get rootDirectory() { return this._rootDirectory; } public putRootDirectory(value: EfsAccessPointRootDirectory) { this._rootDirectory.internalValue = value; } public resetRootDirectory() { this._rootDirectory.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get rootDirectoryInput() { return this._rootDirectory.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { file_system_id: cdktf.stringToTerraform(this._fileSystemId), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), posix_user: efsAccessPointPosixUserToTerraform(this._posixUser.internalValue), root_directory: efsAccessPointRootDirectoryToTerraform(this._rootDirectory.internalValue), }; } }