Skip to content

Commit

Permalink
Merge pull request #14584 from terraform-providers/b-ecr-resource-crash
Browse files Browse the repository at this point in the history
resource/ecr_repository: safely handle nil encryption information returned from API
  • Loading branch information
anGie44 authored Aug 12, 2020
2 parents d5dfe9b + 0818fd5 commit 2de31ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aws/resource_aws_ecr_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ func expandEcrRepositoryEncryptionConfiguration(data []interface{}) *ecr.Encrypt
}

func flattenEcrRepositoryEncryptionConfiguration(ec *ecr.EncryptionConfiguration) []map[string]interface{} {
if ec == nil {
return nil
}

config := map[string]interface{}{
"encryption_type": aws.StringValue(ec.EncryptionType),
"kms_key": aws.StringValue(ec.KmsKey),
Expand Down

0 comments on commit 2de31ed

Please sign in to comment.