Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add App Config Feature Flag type #23719

Merged
merged 11 commits into from
Mar 17, 2022
3 changes: 3 additions & 0 deletions .changelog/23719.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_configuration_profile: Add `type` argument
```
10 changes: 10 additions & 0 deletions internal/service/appconfig/configuration_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ func ResourceConfigurationProfile() *schema.Resource {
Optional: true,
ValidateFunc: verify.ValidARN,
},
"type": {
Type: schema.TypeString,
Optional: true,
Default: "AWS.Freeform",
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z\.]+`), ""),
},
"tags": tftags.TagsSchema(),
"tags_all": tftags.TagsSchemaComputed(),
"validator": {
Expand Down Expand Up @@ -121,6 +127,10 @@ func resourceConfigurationProfileCreate(d *schema.ResourceData, meta interface{}
input.Validators = expandAppconfigValidators(v.(*schema.Set).List())
}

if v, ok := d.GetOk("type"); ok {
input.Type = aws.String(v.(string))
}

profile, err := conn.CreateConfigurationProfile(input)

if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ The following arguments are supported:
* `retrieval_role_arn` - (Optional) The ARN of an IAM role with permission to access the configuration at the specified `location_uri`. A retrieval role ARN is not required for configurations stored in the AWS AppConfig `hosted` configuration store. It is required for all other sources that store your configuration.
* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
* `validator` - (Optional) A set of methods for validating the configuration. Maximum of 2. See [Validator](#validator) below for more details.
* `type` - (Optional) The type of the configuration profile. This will default to `AWS.Freeform`.

### Validator

Expand Down