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

Support CloudFront Field Level Encryption Configurations #15033

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/12509.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
aws_cloudfront_field_level_encryption_profile
```
3 changes: 3 additions & 0 deletions .changelog/15033.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
aws_cloudfront_field_level_encryption_config
```
38 changes: 38 additions & 0 deletions aws/internal/service/cloudfront/finder/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,41 @@ func RealtimeLogConfigByARN(conn *cloudfront.CloudFront, arn string) (*cloudfron

return output.RealtimeLogConfig, nil
}

// FieldLevelEncryptionProfileByID returns the field level encryption profile corresponding to the specified ID.
// Returns nil if no configuration is found.
func FieldLevelEncryptionProfileByID(conn *cloudfront.CloudFront, id string) (*cloudfront.GetFieldLevelEncryptionProfileOutput, error) {
input := &cloudfront.GetFieldLevelEncryptionProfileInput{
Id: aws.String(id),
}

output, err := conn.GetFieldLevelEncryptionProfile(input)
if err != nil {
return nil, err
}

if output == nil {
return nil, nil
}

return output, nil
}

// FieldLevelEncryptionConfigByID returns the field level encryption config corresponding to the specified ID.
// Returns nil if no configuration is found.
func FieldLevelEncryptionConfigByID(conn *cloudfront.CloudFront, id string) (*cloudfront.GetFieldLevelEncryptionConfigOutput, error) {
input := &cloudfront.GetFieldLevelEncryptionConfigInput{
Id: aws.String(id),
}

output, err := conn.GetFieldLevelEncryptionConfig(input)
if err != nil {
return nil, err
}

if output == nil {
return nil, nil
}

return output, nil
}
2 changes: 2 additions & 0 deletions aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,8 @@ func Provider() *schema.Provider {
"aws_cloudformation_type": resourceAwsCloudFormationType(),
"aws_cloudfront_cache_policy": resourceAwsCloudFrontCachePolicy(),
"aws_cloudfront_distribution": resourceAwsCloudFrontDistribution(),
"aws_cloudfront_field_level_encryption_profile": resourceAwsCloudfrontFieldLevelEncryptionProfile(),
"aws_cloudfront_field_level_encryption_config": resourceAwsCloudfrontFieldLevelEncryptionConfig(),
"aws_cloudfront_function": resourceAwsCloudFrontFunction(),
"aws_cloudfront_key_group": resourceAwsCloudFrontKeyGroup(),
"aws_cloudfront_origin_access_identity": resourceAwsCloudFrontOriginAccessIdentity(),
Expand Down
Loading