// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AppStream */ export interface AppstreamDirectoryConfigConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/appstream_directory_config.html#directory_name AppstreamDirectoryConfig#directory_name} */ readonly directoryName: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/appstream_directory_config.html#organizational_unit_distinguished_names AppstreamDirectoryConfig#organizational_unit_distinguished_names} */ readonly organizationalUnitDistinguishedNames: string[]; /** * service_account_credentials block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/appstream_directory_config.html#service_account_credentials AppstreamDirectoryConfig#service_account_credentials} */ readonly serviceAccountCredentials: AppstreamDirectoryConfigServiceAccountCredentials; } export interface AppstreamDirectoryConfigServiceAccountCredentials { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/appstream_directory_config.html#account_name AppstreamDirectoryConfig#account_name} */ readonly accountName: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/appstream_directory_config.html#account_password AppstreamDirectoryConfig#account_password} */ readonly accountPassword: string; } export function appstreamDirectoryConfigServiceAccountCredentialsToTerraform(struct?: AppstreamDirectoryConfigServiceAccountCredentialsOutputReference | AppstreamDirectoryConfigServiceAccountCredentials): 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 { account_name: cdktf.stringToTerraform(struct!.accountName), account_password: cdktf.stringToTerraform(struct!.accountPassword), } } export class AppstreamDirectoryConfigServiceAccountCredentialsOutputReference 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(): AppstreamDirectoryConfigServiceAccountCredentials | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._accountName !== undefined) { hasAnyValues = true; internalValueResult.accountName = this._accountName; } if (this._accountPassword !== undefined) { hasAnyValues = true; internalValueResult.accountPassword = this._accountPassword; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: AppstreamDirectoryConfigServiceAccountCredentials | undefined) { if (value === undefined) { this.isEmptyObject = false; this._accountName = undefined; this._accountPassword = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._accountName = value.accountName; this._accountPassword = value.accountPassword; } } // account_name - computed: false, optional: false, required: true private _accountName?: string; public get accountName() { return this.getStringAttribute('account_name'); } public set accountName(value: string) { this._accountName = value; } // Temporarily expose input value. Use with caution. public get accountNameInput() { return this._accountName; } // account_password - computed: false, optional: false, required: true private _accountPassword?: string; public get accountPassword() { return this.getStringAttribute('account_password'); } public set accountPassword(value: string) { this._accountPassword = value; } // Temporarily expose input value. Use with caution. public get accountPasswordInput() { return this._accountPassword; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/appstream_directory_config.html aws_appstream_directory_config} */ export class AppstreamDirectoryConfig extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_appstream_directory_config"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/appstream_directory_config.html aws_appstream_directory_config} 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 AppstreamDirectoryConfigConfig */ public constructor(scope: Construct, id: string, config: AppstreamDirectoryConfigConfig) { super(scope, id, { terraformResourceType: 'aws_appstream_directory_config', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._directoryName = config.directoryName; this._organizationalUnitDistinguishedNames = config.organizationalUnitDistinguishedNames; this._serviceAccountCredentials.internalValue = config.serviceAccountCredentials; } // ========== // ATTRIBUTES // ========== // created_time - computed: true, optional: false, required: false public get createdTime() { return this.getStringAttribute('created_time'); } // directory_name - computed: false, optional: false, required: true private _directoryName?: string; public get directoryName() { return this.getStringAttribute('directory_name'); } public set directoryName(value: string) { this._directoryName = value; } // Temporarily expose input value. Use with caution. public get directoryNameInput() { return this._directoryName; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // organizational_unit_distinguished_names - computed: false, optional: false, required: true private _organizationalUnitDistinguishedNames?: string[]; public get organizationalUnitDistinguishedNames() { return this.getListAttribute('organizational_unit_distinguished_names'); } public set organizationalUnitDistinguishedNames(value: string[]) { this._organizationalUnitDistinguishedNames = value; } // Temporarily expose input value. Use with caution. public get organizationalUnitDistinguishedNamesInput() { return this._organizationalUnitDistinguishedNames; } // service_account_credentials - computed: false, optional: false, required: true private _serviceAccountCredentials = new AppstreamDirectoryConfigServiceAccountCredentialsOutputReference(this as any, "service_account_credentials", true); public get serviceAccountCredentials() { return this._serviceAccountCredentials; } public putServiceAccountCredentials(value: AppstreamDirectoryConfigServiceAccountCredentials) { this._serviceAccountCredentials.internalValue = value; } // Temporarily expose input value. Use with caution. public get serviceAccountCredentialsInput() { return this._serviceAccountCredentials.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { directory_name: cdktf.stringToTerraform(this._directoryName), organizational_unit_distinguished_names: cdktf.listMapper(cdktf.stringToTerraform)(this._organizationalUnitDistinguishedNames), service_account_credentials: appstreamDirectoryConfigServiceAccountCredentialsToTerraform(this._serviceAccountCredentials.internalValue), }; } }