// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS Batch */ export interface BatchJobDefinitionConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#container_properties BatchJobDefinition#container_properties} */ readonly containerProperties?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#name BatchJobDefinition#name} */ readonly name: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#parameters BatchJobDefinition#parameters} */ readonly parameters?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#platform_capabilities BatchJobDefinition#platform_capabilities} */ readonly platformCapabilities?: string[]; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#propagate_tags BatchJobDefinition#propagate_tags} */ readonly propagateTags?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#tags BatchJobDefinition#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#tags_all BatchJobDefinition#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#type BatchJobDefinition#type} */ readonly type: string; /** * retry_strategy block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#retry_strategy BatchJobDefinition#retry_strategy} */ readonly retryStrategy?: BatchJobDefinitionRetryStrategy; /** * timeout block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#timeout BatchJobDefinition#timeout} */ readonly timeout?: BatchJobDefinitionTimeout; } export interface BatchJobDefinitionRetryStrategyEvaluateOnExit { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#action BatchJobDefinition#action} */ readonly action: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#on_exit_code BatchJobDefinition#on_exit_code} */ readonly onExitCode?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#on_reason BatchJobDefinition#on_reason} */ readonly onReason?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#on_status_reason BatchJobDefinition#on_status_reason} */ readonly onStatusReason?: string; } export function batchJobDefinitionRetryStrategyEvaluateOnExitToTerraform(struct?: BatchJobDefinitionRetryStrategyEvaluateOnExit): 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 { action: cdktf.stringToTerraform(struct!.action), on_exit_code: cdktf.stringToTerraform(struct!.onExitCode), on_reason: cdktf.stringToTerraform(struct!.onReason), on_status_reason: cdktf.stringToTerraform(struct!.onStatusReason), } } export interface BatchJobDefinitionRetryStrategy { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#attempts BatchJobDefinition#attempts} */ readonly attempts?: number; /** * evaluate_on_exit block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#evaluate_on_exit BatchJobDefinition#evaluate_on_exit} */ readonly evaluateOnExit?: BatchJobDefinitionRetryStrategyEvaluateOnExit[]; } export function batchJobDefinitionRetryStrategyToTerraform(struct?: BatchJobDefinitionRetryStrategyOutputReference | BatchJobDefinitionRetryStrategy): 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 { attempts: cdktf.numberToTerraform(struct!.attempts), evaluate_on_exit: cdktf.listMapper(batchJobDefinitionRetryStrategyEvaluateOnExitToTerraform)(struct!.evaluateOnExit), } } export class BatchJobDefinitionRetryStrategyOutputReference 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(): BatchJobDefinitionRetryStrategy | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._attempts !== undefined) { hasAnyValues = true; internalValueResult.attempts = this._attempts; } if (this._evaluateOnExit !== undefined) { hasAnyValues = true; internalValueResult.evaluateOnExit = this._evaluateOnExit; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: BatchJobDefinitionRetryStrategy | undefined) { if (value === undefined) { this.isEmptyObject = false; this._attempts = undefined; this._evaluateOnExit = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._attempts = value.attempts; this._evaluateOnExit = value.evaluateOnExit; } } // attempts - computed: false, optional: true, required: false private _attempts?: number; public get attempts() { return this.getNumberAttribute('attempts'); } public set attempts(value: number) { this._attempts = value; } public resetAttempts() { this._attempts = undefined; } // Temporarily expose input value. Use with caution. public get attemptsInput() { return this._attempts; } // evaluate_on_exit - computed: false, optional: true, required: false private _evaluateOnExit?: BatchJobDefinitionRetryStrategyEvaluateOnExit[]; public get evaluateOnExit() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('evaluate_on_exit') as any; } public set evaluateOnExit(value: BatchJobDefinitionRetryStrategyEvaluateOnExit[]) { this._evaluateOnExit = value; } public resetEvaluateOnExit() { this._evaluateOnExit = undefined; } // Temporarily expose input value. Use with caution. public get evaluateOnExitInput() { return this._evaluateOnExit; } } export interface BatchJobDefinitionTimeout { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html#attempt_duration_seconds BatchJobDefinition#attempt_duration_seconds} */ readonly attemptDurationSeconds?: number; } export function batchJobDefinitionTimeoutToTerraform(struct?: BatchJobDefinitionTimeoutOutputReference | BatchJobDefinitionTimeout): 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 { attempt_duration_seconds: cdktf.numberToTerraform(struct!.attemptDurationSeconds), } } export class BatchJobDefinitionTimeoutOutputReference 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(): BatchJobDefinitionTimeout | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._attemptDurationSeconds !== undefined) { hasAnyValues = true; internalValueResult.attemptDurationSeconds = this._attemptDurationSeconds; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: BatchJobDefinitionTimeout | undefined) { if (value === undefined) { this.isEmptyObject = false; this._attemptDurationSeconds = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._attemptDurationSeconds = value.attemptDurationSeconds; } } // attempt_duration_seconds - computed: false, optional: true, required: false private _attemptDurationSeconds?: number; public get attemptDurationSeconds() { return this.getNumberAttribute('attempt_duration_seconds'); } public set attemptDurationSeconds(value: number) { this._attemptDurationSeconds = value; } public resetAttemptDurationSeconds() { this._attemptDurationSeconds = undefined; } // Temporarily expose input value. Use with caution. public get attemptDurationSecondsInput() { return this._attemptDurationSeconds; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html aws_batch_job_definition} */ export class BatchJobDefinition extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_batch_job_definition"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition.html aws_batch_job_definition} 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 BatchJobDefinitionConfig */ public constructor(scope: Construct, id: string, config: BatchJobDefinitionConfig) { super(scope, id, { terraformResourceType: 'aws_batch_job_definition', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._containerProperties = config.containerProperties; this._name = config.name; this._parameters = config.parameters; this._platformCapabilities = config.platformCapabilities; this._propagateTags = config.propagateTags; this._tags = config.tags; this._tagsAll = config.tagsAll; this._type = config.type; this._retryStrategy.internalValue = config.retryStrategy; this._timeout.internalValue = config.timeout; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // container_properties - computed: false, optional: true, required: false private _containerProperties?: string; public get containerProperties() { return this.getStringAttribute('container_properties'); } public set containerProperties(value: string) { this._containerProperties = value; } public resetContainerProperties() { this._containerProperties = undefined; } // Temporarily expose input value. Use with caution. public get containerPropertiesInput() { return this._containerProperties; } // 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; } // parameters - computed: false, optional: true, required: false private _parameters?: { [key: string]: string } | cdktf.IResolvable; public get parameters() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('parameters') as any; } public set parameters(value: { [key: string]: string } | cdktf.IResolvable) { this._parameters = value; } public resetParameters() { this._parameters = undefined; } // Temporarily expose input value. Use with caution. public get parametersInput() { return this._parameters; } // platform_capabilities - computed: false, optional: true, required: false private _platformCapabilities?: string[]; public get platformCapabilities() { return this.getListAttribute('platform_capabilities'); } public set platformCapabilities(value: string[]) { this._platformCapabilities = value; } public resetPlatformCapabilities() { this._platformCapabilities = undefined; } // Temporarily expose input value. Use with caution. public get platformCapabilitiesInput() { return this._platformCapabilities; } // propagate_tags - computed: false, optional: true, required: false private _propagateTags?: boolean | cdktf.IResolvable; public get propagateTags() { return this.getBooleanAttribute('propagate_tags') as any; } public set propagateTags(value: boolean | cdktf.IResolvable) { this._propagateTags = value; } public resetPropagateTags() { this._propagateTags = undefined; } // Temporarily expose input value. Use with caution. public get propagateTagsInput() { return this._propagateTags; } // revision - computed: true, optional: false, required: false public get revision() { return this.getNumberAttribute('revision'); } // 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: 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; } // retry_strategy - computed: false, optional: true, required: false private _retryStrategy = new BatchJobDefinitionRetryStrategyOutputReference(this as any, "retry_strategy", true); public get retryStrategy() { return this._retryStrategy; } public putRetryStrategy(value: BatchJobDefinitionRetryStrategy) { this._retryStrategy.internalValue = value; } public resetRetryStrategy() { this._retryStrategy.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get retryStrategyInput() { return this._retryStrategy.internalValue; } // timeout - computed: false, optional: true, required: false private _timeout = new BatchJobDefinitionTimeoutOutputReference(this as any, "timeout", true); public get timeout() { return this._timeout; } public putTimeout(value: BatchJobDefinitionTimeout) { this._timeout.internalValue = value; } public resetTimeout() { this._timeout.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get timeoutInput() { return this._timeout.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { container_properties: cdktf.stringToTerraform(this._containerProperties), name: cdktf.stringToTerraform(this._name), parameters: cdktf.hashMapper(cdktf.anyToTerraform)(this._parameters), platform_capabilities: cdktf.listMapper(cdktf.stringToTerraform)(this._platformCapabilities), propagate_tags: cdktf.booleanToTerraform(this._propagateTags), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), type: cdktf.stringToTerraform(this._type), retry_strategy: batchJobDefinitionRetryStrategyToTerraform(this._retryStrategy.internalValue), timeout: batchJobDefinitionTimeoutToTerraform(this._timeout.internalValue), }; } }