Skip to content

Commit

Permalink
Add acceptance test for aws_ses_configuration_set resource updates
Browse files Browse the repository at this point in the history
Update r/aws_ses_configuration_set documentation for delivery_options/tls_policy
References #11197
  • Loading branch information
mjay-taskize authored and anGie44 committed Feb 11, 2021
1 parent 9e27396 commit b4983ad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
9 changes: 6 additions & 3 deletions aws/resource_aws_ses_configuration_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ func resourceAwsSesConfigurationSet() *schema.Resource {
Schema: map[string]*schema.Schema{
"tls_policy": {
Type: schema.TypeString,
Required: true,
Optional: true,
Default: ses.TlsPolicyOptional,
ValidateFunc: validation.StringInSlice([]string{
ses.TlsPolicyRequire,
ses.TlsPolicyOptional,
Expand Down Expand Up @@ -116,9 +117,11 @@ func resourceAwsSesConfigurationSetRead(d *schema.ResourceData, meta interface{}
tlsPolicy := map[string]interface{}{
"tls_policy": response.DeliveryOptions.TlsPolicy,
}

deliveryOptions = append(deliveryOptions, tlsPolicy)
d.Set("delivery_options", deliveryOptions)

if err := d.Set("delivery_options", deliveryOptions); err != nil {
return fmt.Errorf("Error setting delivery_options for SES configuration set %s: %s", d.Id(), err)
}
}

d.Set("name", aws.StringValue(response.ConfigurationSet.Name))
Expand Down
16 changes: 16 additions & 0 deletions website/docs/r/ses_configuration_set.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,28 @@ resource "aws_ses_configuration_set" "test" {
}
```

### Require TLS Connections

```hcl
resource "aws_ses_configuration_set" "test" {
name = "some-configuration-set-test"
delivery_options {
tls_policy = "Require"
}
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Required) The name of the configuration set

Delivery Options (`delivery_options`) support the following:

* `tls_policy` - (Optional) Specifies whether messages that use the configuration set are required to use Transport Layer Security (TLS). Valid values: `Require` and `Optional`. If the value is `Require`, messages are only delivered if a TLS connection can be established. If the value is `Optional`, messages can be delivered in plain text if a TLS connection can't be established. Defaults to `Optional`.

## Import

SES Configuration Sets can be imported using their `name`, e.g.
Expand Down

0 comments on commit b4983ad

Please sign in to comment.