// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS Step Functions */ export interface SfnStateMachineConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html#definition SfnStateMachine#definition} */ readonly definition: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html#name SfnStateMachine#name} */ readonly name: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html#role_arn SfnStateMachine#role_arn} */ readonly roleArn: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html#tags SfnStateMachine#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html#tags_all SfnStateMachine#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html#type SfnStateMachine#type} */ readonly type?: string; /** * logging_configuration block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html#logging_configuration SfnStateMachine#logging_configuration} */ readonly loggingConfiguration?: SfnStateMachineLoggingConfiguration; /** * tracing_configuration block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html#tracing_configuration SfnStateMachine#tracing_configuration} */ readonly tracingConfiguration?: SfnStateMachineTracingConfiguration; } export interface SfnStateMachineLoggingConfiguration { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html#include_execution_data SfnStateMachine#include_execution_data} */ readonly includeExecutionData?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html#level SfnStateMachine#level} */ readonly level?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html#log_destination SfnStateMachine#log_destination} */ readonly logDestination?: string; } export function sfnStateMachineLoggingConfigurationToTerraform(struct?: SfnStateMachineLoggingConfigurationOutputReference | SfnStateMachineLoggingConfiguration): 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 { include_execution_data: cdktf.booleanToTerraform(struct!.includeExecutionData), level: cdktf.stringToTerraform(struct!.level), log_destination: cdktf.stringToTerraform(struct!.logDestination), } } export class SfnStateMachineLoggingConfigurationOutputReference 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(): SfnStateMachineLoggingConfiguration | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._includeExecutionData !== undefined) { hasAnyValues = true; internalValueResult.includeExecutionData = this._includeExecutionData; } if (this._level !== undefined) { hasAnyValues = true; internalValueResult.level = this._level; } if (this._logDestination !== undefined) { hasAnyValues = true; internalValueResult.logDestination = this._logDestination; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: SfnStateMachineLoggingConfiguration | undefined) { if (value === undefined) { this.isEmptyObject = false; this._includeExecutionData = undefined; this._level = undefined; this._logDestination = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._includeExecutionData = value.includeExecutionData; this._level = value.level; this._logDestination = value.logDestination; } } // include_execution_data - computed: false, optional: true, required: false private _includeExecutionData?: boolean | cdktf.IResolvable; public get includeExecutionData() { return this.getBooleanAttribute('include_execution_data') as any; } public set includeExecutionData(value: boolean | cdktf.IResolvable) { this._includeExecutionData = value; } public resetIncludeExecutionData() { this._includeExecutionData = undefined; } // Temporarily expose input value. Use with caution. public get includeExecutionDataInput() { return this._includeExecutionData; } // level - computed: false, optional: true, required: false private _level?: string; public get level() { return this.getStringAttribute('level'); } public set level(value: string) { this._level = value; } public resetLevel() { this._level = undefined; } // Temporarily expose input value. Use with caution. public get levelInput() { return this._level; } // log_destination - computed: false, optional: true, required: false private _logDestination?: string; public get logDestination() { return this.getStringAttribute('log_destination'); } public set logDestination(value: string) { this._logDestination = value; } public resetLogDestination() { this._logDestination = undefined; } // Temporarily expose input value. Use with caution. public get logDestinationInput() { return this._logDestination; } } export interface SfnStateMachineTracingConfiguration { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html#enabled SfnStateMachine#enabled} */ readonly enabled?: boolean | cdktf.IResolvable; } export function sfnStateMachineTracingConfigurationToTerraform(struct?: SfnStateMachineTracingConfigurationOutputReference | SfnStateMachineTracingConfiguration): 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 { enabled: cdktf.booleanToTerraform(struct!.enabled), } } export class SfnStateMachineTracingConfigurationOutputReference 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(): SfnStateMachineTracingConfiguration | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._enabled !== undefined) { hasAnyValues = true; internalValueResult.enabled = this._enabled; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: SfnStateMachineTracingConfiguration | undefined) { if (value === undefined) { this.isEmptyObject = false; this._enabled = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._enabled = value.enabled; } } // enabled - computed: false, optional: true, required: false private _enabled?: boolean | cdktf.IResolvable; public get enabled() { return this.getBooleanAttribute('enabled') as any; } public set enabled(value: boolean | cdktf.IResolvable) { this._enabled = value; } public resetEnabled() { this._enabled = undefined; } // Temporarily expose input value. Use with caution. public get enabledInput() { return this._enabled; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html aws_sfn_state_machine} */ export class SfnStateMachine extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_sfn_state_machine"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/sfn_state_machine.html aws_sfn_state_machine} 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 SfnStateMachineConfig */ public constructor(scope: Construct, id: string, config: SfnStateMachineConfig) { super(scope, id, { terraformResourceType: 'aws_sfn_state_machine', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._definition = config.definition; this._name = config.name; this._roleArn = config.roleArn; this._tags = config.tags; this._tagsAll = config.tagsAll; this._type = config.type; this._loggingConfiguration.internalValue = config.loggingConfiguration; this._tracingConfiguration.internalValue = config.tracingConfiguration; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // creation_date - computed: true, optional: false, required: false public get creationDate() { return this.getStringAttribute('creation_date'); } // definition - computed: false, optional: false, required: true private _definition?: string; public get definition() { return this.getStringAttribute('definition'); } public set definition(value: string) { this._definition = value; } // Temporarily expose input value. Use with caution. public get definitionInput() { return this._definition; } // 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; } // role_arn - computed: false, optional: false, required: true private _roleArn?: string; public get roleArn() { return this.getStringAttribute('role_arn'); } public set roleArn(value: string) { this._roleArn = value; } // Temporarily expose input value. Use with caution. public get roleArnInput() { return this._roleArn; } // status - computed: true, optional: false, required: false public get status() { return this.getStringAttribute('status'); } // 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; } // 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; } // logging_configuration - computed: false, optional: true, required: false private _loggingConfiguration = new SfnStateMachineLoggingConfigurationOutputReference(this as any, "logging_configuration", true); public get loggingConfiguration() { return this._loggingConfiguration; } public putLoggingConfiguration(value: SfnStateMachineLoggingConfiguration) { this._loggingConfiguration.internalValue = value; } public resetLoggingConfiguration() { this._loggingConfiguration.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get loggingConfigurationInput() { return this._loggingConfiguration.internalValue; } // tracing_configuration - computed: false, optional: true, required: false private _tracingConfiguration = new SfnStateMachineTracingConfigurationOutputReference(this as any, "tracing_configuration", true); public get tracingConfiguration() { return this._tracingConfiguration; } public putTracingConfiguration(value: SfnStateMachineTracingConfiguration) { this._tracingConfiguration.internalValue = value; } public resetTracingConfiguration() { this._tracingConfiguration.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get tracingConfigurationInput() { return this._tracingConfiguration.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { definition: cdktf.stringToTerraform(this._definition), name: cdktf.stringToTerraform(this._name), role_arn: cdktf.stringToTerraform(this._roleArn), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), type: cdktf.stringToTerraform(this._type), logging_configuration: sfnStateMachineLoggingConfigurationToTerraform(this._loggingConfiguration.internalValue), tracing_configuration: sfnStateMachineTracingConfigurationToTerraform(this._tracingConfiguration.internalValue), }; } }