// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * Amazon API Gateway Websocket and HTTP APIs */ export interface Apigatewayv2AuthorizerConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html#api_id Apigatewayv2Authorizer#api_id} */ readonly apiId: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html#authorizer_credentials_arn Apigatewayv2Authorizer#authorizer_credentials_arn} */ readonly authorizerCredentialsArn?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html#authorizer_payload_format_version Apigatewayv2Authorizer#authorizer_payload_format_version} */ readonly authorizerPayloadFormatVersion?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html#authorizer_result_ttl_in_seconds Apigatewayv2Authorizer#authorizer_result_ttl_in_seconds} */ readonly authorizerResultTtlInSeconds?: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html#authorizer_type Apigatewayv2Authorizer#authorizer_type} */ readonly authorizerType: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html#authorizer_uri Apigatewayv2Authorizer#authorizer_uri} */ readonly authorizerUri?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html#enable_simple_responses Apigatewayv2Authorizer#enable_simple_responses} */ readonly enableSimpleResponses?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html#identity_sources Apigatewayv2Authorizer#identity_sources} */ readonly identitySources?: string[]; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html#name Apigatewayv2Authorizer#name} */ readonly name: string; /** * jwt_configuration block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html#jwt_configuration Apigatewayv2Authorizer#jwt_configuration} */ readonly jwtConfiguration?: Apigatewayv2AuthorizerJwtConfiguration; } export interface Apigatewayv2AuthorizerJwtConfiguration { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html#audience Apigatewayv2Authorizer#audience} */ readonly audience?: string[]; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html#issuer Apigatewayv2Authorizer#issuer} */ readonly issuer?: string; } export function apigatewayv2AuthorizerJwtConfigurationToTerraform(struct?: Apigatewayv2AuthorizerJwtConfigurationOutputReference | Apigatewayv2AuthorizerJwtConfiguration): 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 { audience: cdktf.listMapper(cdktf.stringToTerraform)(struct!.audience), issuer: cdktf.stringToTerraform(struct!.issuer), } } export class Apigatewayv2AuthorizerJwtConfigurationOutputReference 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(): Apigatewayv2AuthorizerJwtConfiguration | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._audience !== undefined) { hasAnyValues = true; internalValueResult.audience = this._audience; } if (this._issuer !== undefined) { hasAnyValues = true; internalValueResult.issuer = this._issuer; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: Apigatewayv2AuthorizerJwtConfiguration | undefined) { if (value === undefined) { this.isEmptyObject = false; this._audience = undefined; this._issuer = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._audience = value.audience; this._issuer = value.issuer; } } // audience - computed: false, optional: true, required: false private _audience?: string[]; public get audience() { return this.getListAttribute('audience'); } public set audience(value: string[]) { this._audience = value; } public resetAudience() { this._audience = undefined; } // Temporarily expose input value. Use with caution. public get audienceInput() { return this._audience; } // issuer - computed: false, optional: true, required: false private _issuer?: string; public get issuer() { return this.getStringAttribute('issuer'); } public set issuer(value: string) { this._issuer = value; } public resetIssuer() { this._issuer = undefined; } // Temporarily expose input value. Use with caution. public get issuerInput() { return this._issuer; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html aws_apigatewayv2_authorizer} */ export class Apigatewayv2Authorizer extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_apigatewayv2_authorizer"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer.html aws_apigatewayv2_authorizer} 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 Apigatewayv2AuthorizerConfig */ public constructor(scope: Construct, id: string, config: Apigatewayv2AuthorizerConfig) { super(scope, id, { terraformResourceType: 'aws_apigatewayv2_authorizer', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._apiId = config.apiId; this._authorizerCredentialsArn = config.authorizerCredentialsArn; this._authorizerPayloadFormatVersion = config.authorizerPayloadFormatVersion; this._authorizerResultTtlInSeconds = config.authorizerResultTtlInSeconds; this._authorizerType = config.authorizerType; this._authorizerUri = config.authorizerUri; this._enableSimpleResponses = config.enableSimpleResponses; this._identitySources = config.identitySources; this._name = config.name; this._jwtConfiguration.internalValue = config.jwtConfiguration; } // ========== // ATTRIBUTES // ========== // api_id - computed: false, optional: false, required: true private _apiId?: string; public get apiId() { return this.getStringAttribute('api_id'); } public set apiId(value: string) { this._apiId = value; } // Temporarily expose input value. Use with caution. public get apiIdInput() { return this._apiId; } // authorizer_credentials_arn - computed: false, optional: true, required: false private _authorizerCredentialsArn?: string; public get authorizerCredentialsArn() { return this.getStringAttribute('authorizer_credentials_arn'); } public set authorizerCredentialsArn(value: string) { this._authorizerCredentialsArn = value; } public resetAuthorizerCredentialsArn() { this._authorizerCredentialsArn = undefined; } // Temporarily expose input value. Use with caution. public get authorizerCredentialsArnInput() { return this._authorizerCredentialsArn; } // authorizer_payload_format_version - computed: false, optional: true, required: false private _authorizerPayloadFormatVersion?: string; public get authorizerPayloadFormatVersion() { return this.getStringAttribute('authorizer_payload_format_version'); } public set authorizerPayloadFormatVersion(value: string) { this._authorizerPayloadFormatVersion = value; } public resetAuthorizerPayloadFormatVersion() { this._authorizerPayloadFormatVersion = undefined; } // Temporarily expose input value. Use with caution. public get authorizerPayloadFormatVersionInput() { return this._authorizerPayloadFormatVersion; } // authorizer_result_ttl_in_seconds - computed: true, optional: true, required: false private _authorizerResultTtlInSeconds?: number; public get authorizerResultTtlInSeconds() { return this.getNumberAttribute('authorizer_result_ttl_in_seconds'); } public set authorizerResultTtlInSeconds(value: number) { this._authorizerResultTtlInSeconds = value; } public resetAuthorizerResultTtlInSeconds() { this._authorizerResultTtlInSeconds = undefined; } // Temporarily expose input value. Use with caution. public get authorizerResultTtlInSecondsInput() { return this._authorizerResultTtlInSeconds; } // authorizer_type - computed: false, optional: false, required: true private _authorizerType?: string; public get authorizerType() { return this.getStringAttribute('authorizer_type'); } public set authorizerType(value: string) { this._authorizerType = value; } // Temporarily expose input value. Use with caution. public get authorizerTypeInput() { return this._authorizerType; } // authorizer_uri - computed: false, optional: true, required: false private _authorizerUri?: string; public get authorizerUri() { return this.getStringAttribute('authorizer_uri'); } public set authorizerUri(value: string) { this._authorizerUri = value; } public resetAuthorizerUri() { this._authorizerUri = undefined; } // Temporarily expose input value. Use with caution. public get authorizerUriInput() { return this._authorizerUri; } // enable_simple_responses - computed: false, optional: true, required: false private _enableSimpleResponses?: boolean | cdktf.IResolvable; public get enableSimpleResponses() { return this.getBooleanAttribute('enable_simple_responses') as any; } public set enableSimpleResponses(value: boolean | cdktf.IResolvable) { this._enableSimpleResponses = value; } public resetEnableSimpleResponses() { this._enableSimpleResponses = undefined; } // Temporarily expose input value. Use with caution. public get enableSimpleResponsesInput() { return this._enableSimpleResponses; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // identity_sources - computed: false, optional: true, required: false private _identitySources?: string[]; public get identitySources() { return this.getListAttribute('identity_sources'); } public set identitySources(value: string[]) { this._identitySources = value; } public resetIdentitySources() { this._identitySources = undefined; } // Temporarily expose input value. Use with caution. public get identitySourcesInput() { return this._identitySources; } // 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; } // jwt_configuration - computed: false, optional: true, required: false private _jwtConfiguration = new Apigatewayv2AuthorizerJwtConfigurationOutputReference(this as any, "jwt_configuration", true); public get jwtConfiguration() { return this._jwtConfiguration; } public putJwtConfiguration(value: Apigatewayv2AuthorizerJwtConfiguration) { this._jwtConfiguration.internalValue = value; } public resetJwtConfiguration() { this._jwtConfiguration.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get jwtConfigurationInput() { return this._jwtConfiguration.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { api_id: cdktf.stringToTerraform(this._apiId), authorizer_credentials_arn: cdktf.stringToTerraform(this._authorizerCredentialsArn), authorizer_payload_format_version: cdktf.stringToTerraform(this._authorizerPayloadFormatVersion), authorizer_result_ttl_in_seconds: cdktf.numberToTerraform(this._authorizerResultTtlInSeconds), authorizer_type: cdktf.stringToTerraform(this._authorizerType), authorizer_uri: cdktf.stringToTerraform(this._authorizerUri), enable_simple_responses: cdktf.booleanToTerraform(this._enableSimpleResponses), identity_sources: cdktf.listMapper(cdktf.stringToTerraform)(this._identitySources), name: cdktf.stringToTerraform(this._name), jwt_configuration: apigatewayv2AuthorizerJwtConfigurationToTerraform(this._jwtConfiguration.internalValue), }; } }