From 3668e4ee72c3a26b67378486f36c0c9186fd8313 Mon Sep 17 00:00:00 2001 From: Samseppiol Date: Wed, 8 Jan 2020 14:48:35 +1100 Subject: [PATCH] Convert component to use new cfndsl yaml constant syntax --- s3-cloudfront.cfndsl.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/s3-cloudfront.cfndsl.rb b/s3-cloudfront.cfndsl.rb index 21afcd3..cf76b6f 100644 --- a/s3-cloudfront.cfndsl.rb +++ b/s3-cloudfront.cfndsl.rb @@ -13,8 +13,8 @@ ] } -if defined? bucket_policy + bucket_policy = external_parameters.fetch(bucket_policy, {}) bucket_policy.each do |sid, statement_config| statement = {} statement["Sid"] = sid @@ -26,11 +26,9 @@ policy_document[:Statement] << statement end -end - S3_Bucket('Bucket') do - BucketName FnSub(bucket_name) + BucketName FnSub(external_parameters[:bucket_name]) end S3_BucketPolicy("BucketPolicy") do