diff --git a/providers/aws/resources.ts b/providers/aws/resources.ts index 70082b2..c04cb76 100644 --- a/providers/aws/resources.ts +++ b/providers/aws/resources.ts @@ -4258,6 +4258,9 @@ export interface ElasticsearchDomainParams { cluster_config?: ElasticsearchDomainClusterConfigParams; snapshot_options?: ElasticsearchDomainSnapshotOptionsParams; cognito_options?: ElasticsearchDomainCognitoOptionsParams; + domain_endpoint_options?: ElasticsearchDomainEndpointOptionsParams; + encrypt_at_rest?: ElasticsearchEncryptAtRestParams; + node_to_node_encryption?: ElasticsearchNodeToNodeEncryptionParams; vpc_options?: ElasticsearchDomainVpcOptionsParams; elasticsearch_version?: string; tags?: TF.TagsMap; @@ -4272,6 +4275,9 @@ export function fieldsFromElasticsearchDomainParams(params: ElasticsearchDomainP TF.addOptionalBlock(fields, "cluster_config", params.cluster_config, fieldsFromElasticsearchDomainClusterConfigParams); TF.addOptionalBlock(fields, "snapshot_options", params.snapshot_options, fieldsFromElasticsearchDomainSnapshotOptionsParams); TF.addOptionalBlock(fields, "cognito_options", params.cognito_options, fieldsFromElasticsearchDomainCognitoOptionsParams); + TF.addOptionalBlock(fields, "domain_endpoint_options", params.domain_endpoint_options, fieldsFromElasticsearchDomainEndpointOptionsParams); + TF.addOptionalBlock(fields, "encrypt_at_rest", params.encrypt_at_rest, fieldsFromElasticsearchEncryptAtRestParams); + TF.addOptionalBlock(fields, "node_to_node_encryption", params.node_to_node_encryption, fieldsFromElasticsearchNodeToNodeEncryptionParams); TF.addOptionalBlock(fields, "vpc_options", params.vpc_options, fieldsFromElasticsearchDomainVpcOptionsParams); TF.addOptionalAttribute(fields, "elasticsearch_version", params.elasticsearch_version, TF.stringValue); TF.addOptionalAttribute(fields, "tags", params.tags, TF.tagsValue); @@ -4364,6 +4370,46 @@ export function fieldsFromElasticsearchDomainPolicyParams(params: ElasticsearchD return fields; } +export interface ElasticsearchDomainEndpointOptionsParams { + custom_endpoint_certificate_arn?: AT.ArnT<"AcmCertificate">; + custom_endpoint_enabled?: boolean; + custom_endpoint?: string; + enforce_https?: boolean; + tls_security_policy?: string; +} + +export function fieldsFromElasticsearchDomainEndpointOptionsParams(params: ElasticsearchDomainEndpointOptionsParams) : TF.ResourceFieldMap { + const fields: TF.ResourceFieldMap = []; + TF.addOptionalAttribute(fields, "custom_endpoint_certificate_arn", params.custom_endpoint_certificate_arn, TF.resourceArnValue); + TF.addOptionalAttribute(fields, "custom_endpoint_enabled", params.custom_endpoint_enabled, TF.booleanValue); + TF.addOptionalAttribute(fields, "custom_endpoint", params.custom_endpoint, TF.stringValue); + TF.addOptionalAttribute(fields, "enforce_https", params.enforce_https, TF.booleanValue); + TF.addOptionalAttribute(fields, "tls_security_policy", params.tls_security_policy, TF.stringValue); + return fields; +} + +export interface ElasticsearchEncryptAtRestParams { + enabled: boolean; + kms_key_id?: string; +} + +export function fieldsFromElasticsearchEncryptAtRestParams(params: ElasticsearchEncryptAtRestParams) : TF.ResourceFieldMap { + const fields: TF.ResourceFieldMap = []; + TF.addAttribute(fields, "enabled", params.enabled, TF.booleanValue); + TF.addOptionalAttribute(fields, "kms_key_id", params.kms_key_id, TF.stringValue); + return fields; +} + +export interface ElasticsearchNodeToNodeEncryptionParams { + enabled: boolean; +} + +export function fieldsFromElasticsearchNodeToNodeEncryptionParams(params: ElasticsearchNodeToNodeEncryptionParams) : TF.ResourceFieldMap { + const fields: TF.ResourceFieldMap = []; + TF.addAttribute(fields, "enabled", params.enabled, TF.booleanValue); + return fields; +} + export interface AcmCertificateParams { domain_name: string; subject_alternative_names?: (string)[]; diff --git a/providers/aws/types.ts b/providers/aws/types.ts index 762fd2e..752c0f1 100644 --- a/providers/aws/types.ts +++ b/providers/aws/types.ts @@ -435,10 +435,10 @@ export const m4_10xlarge_elasticsearch = esInstanceType( 'm4.10xlarge.elasticsearch' ); export const m6g_xlarge_elasticsearch = esInstanceType( - 'm6g.xlarge.search' + 'm6g.xlarge.elasticsearch' ); export const m6g_large_elasticsearch = esInstanceType( - 'm6g.large.search' + 'm6g.large.elasticsearch' ); export const c4_large_elasticsearch = esInstanceType('c4.large.elasticsearch'); export const c4_xlarge_elasticsearch = esInstanceType( diff --git a/tools/gen-providers.ts b/tools/gen-providers.ts index 98a745e..ab86b80 100644 --- a/tools/gen-providers.ts +++ b/tools/gen-providers.ts @@ -1126,6 +1126,32 @@ const elasticsearch_domain_cognito_options: RecordDecl = { ], }; +const elasticsearch_domain_endpoint_options: RecordDecl = { + name: 'elasticsearch_domain_endpoint_options', + fields: [ + optionalField('custom_endpoint_certificate_arn', arnType(acm_certificate)), + optionalField('custom_endpoint_enabled', BOOLEAN), + optionalField('custom_endpoint', STRING), + optionalField('enforce_https', BOOLEAN), + optionalField('tls_security_policy', STRING), + ], +}; + +const elasticsearch_node_to_node_encryption: RecordDecl = { + name: 'elasticsearch_node_to_node_encryption', + fields: [ + requiredField('enabled', BOOLEAN), + ], +}; + +const elasticsearch_encrypt_at_rest: RecordDecl = { + name: 'elasticsearch_encrypt_at_rest', + fields: [ + requiredField('enabled', BOOLEAN), + optionalField('kms_key_id', STRING), + ], +}; + const elasticsearch_domain: RecordDecl = { name: 'elasticsearch_domain', fields: [ @@ -1145,6 +1171,18 @@ const elasticsearch_domain: RecordDecl = { 'cognito_options', recordType(elasticsearch_domain_cognito_options) ), + optionalField( + 'domain_endpoint_options', + recordType(elasticsearch_domain_endpoint_options) + ), + optionalField( + 'encrypt_at_rest', + recordType(elasticsearch_encrypt_at_rest) + ), + optionalField( + 'node_to_node_encryption', + recordType(elasticsearch_node_to_node_encryption) + ), optionalField('vpc_options', recordType(elasticsearch_domain_vpc_options)), optionalField('elasticsearch_version', STRING), optionalField('tags', TAGS_MAP), @@ -3886,6 +3924,9 @@ function generateAws(gen: Generator) { gen.generateParams(elasticsearch_domain_vpc_options); gen.generateParams(elasticsearch_domain_cognito_options); gen.generateParams(elasticsearch_domain_policy); + gen.generateParams(elasticsearch_domain_endpoint_options); + gen.generateParams(elasticsearch_encrypt_at_rest); + gen.generateParams(elasticsearch_node_to_node_encryption); gen.generateParams(acm_certificate); gen.generateParams(acm_certificate_validation); gen.generateParams(lb_listener_certificate);