Skip to content

Commit

Permalink
Remove Computed from forwarded_values
Browse files Browse the repository at this point in the history
  • Loading branch information
bill-rich committed Mar 11, 2021
1 parent 7ca2615 commit 8f7c41c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/18042.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_cloudfront_distribution: Allow `forwarded_values` to be set to empty when values were previously set
```
2 changes: 0 additions & 2 deletions aws/resource_aws_cloudfront_distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ func resourceAwsCloudFrontDistribution() *schema.Resource {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"cookies": {
Expand Down Expand Up @@ -257,7 +256,6 @@ func resourceAwsCloudFrontDistribution() *schema.Resource {
"forwarded_values": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down
24 changes: 24 additions & 0 deletions aws/resource_aws_cloudfront_distribution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,30 @@ func TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy(t *testing
})
}

func TestAccAWSCloudFrontDistribution_forwardedValuesToCachePolicy(t *testing.T) {
var distribution cloudfront.Distribution
resourceName := "aws_cloudfront_distribution.main"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckCloudFrontDistributionDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSCloudFrontDistributionOrderedCacheBehavior,
Check: resource.ComposeTestCheckFunc(
testAccCheckCloudFrontDistributionExists(resourceName, &distribution),
),
},
{
Config: testAccAWSCloudFrontDistributionOrderedCacheBehaviorCachePolicy,
Check: resource.ComposeTestCheckFunc(
testAccCheckCloudFrontDistributionExists(resourceName, &distribution),
),
},
},
})
}

func TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) },
Expand Down

0 comments on commit 8f7c41c

Please sign in to comment.