Cox-Automotive / terraform-provider-alks

Terraform Provider for ALKS
MIT License
37 stars 23 forks source link

Role name validation #163

Closed americk0 closed 2 years ago

americk0 commented 2 years ago

Copied from the PR #162 by Cory Downey (I just added a single commit and changed the target to match our current git flow):

This will add validation for name and name_prefix on the alks_iamrole and alks_iamtrustrole resources.

The for name, validations include: 1) name value length is <= 64 characters 2) name value matches the regex in AWS docs

The for name_prefix, validations include: 1) name_prefix value + unique suffix length is <= 64 2) name_prefix value matches the regex in AWS docs

Adding in this validation will ensure that IAM role naming issues are caught during the tf plan rather than during tf apply.