Skip to content

[Enhancement]: Validate OpenSearch Serverless JSON arguments #33721

@jar-b

Description

@jar-b

Description

The OpenSearch Serverless access policy and security policy resources currently only validate length limits for their respective policy arguments. Confirming the string is valid JSON and contains no duplicate keys could produce improved error messaging for practitioners.

"policy": schema.StringAttribute{
Required: true,
Validators: []validator.String{
stringvalidator.LengthBetween(1, 20480),
},
},

"policy": schema.StringAttribute{
Required: true,
Validators: []validator.String{
stringvalidator.LengthBetween(1, 20480),
},
},

Affected Resource(s) and/or Data Source(s)

  • aws_opensearchserverless_access_policy
  • aws_opensearchserverless_security_policy

Potential Terraform Configuration

No response

References

Relates #33026

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequests to existing resources that expand the functionality or scope.service/opensearchserverlessIssues and PRs that pertain to the opensearchserverless service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions