Skip to content

Commit

Permalink
add custom export names
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunmenon95 committed Dec 10, 2024
1 parent 1e0362b commit 6ae8486
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions s3.cfndsl.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
CloudFormation do

export = external_parameters.fetch(:export_name, external_parameters[:component_name])

buckets = external_parameters.fetch(:buckets, {})
buckets.each do |bucket, config|

Expand Down Expand Up @@ -169,7 +171,7 @@
Output(safe_bucket_name) { Value(Ref(safe_bucket_name)) }
Output(safe_bucket_name + 'DomainName') do
Value FnGetAtt(safe_bucket_name, 'DomainName')
Export FnSub("${EnvironmentName}-#{safe_bucket_name}-domain-name")
Export FnSub("${EnvironmentName}-#{export}-#{safe_bucket_name}-domain-name")
end

if origin_access_identity
Expand All @@ -181,7 +183,7 @@

Output("#{safe_bucket_name}OriginAccessIdentity") do
Value Ref("#{safe_bucket_name}OriginAccessIdentity")
Export FnSub("${EnvironmentName}-#{safe_bucket_name}-origin-access-identity")
Export FnSub("${EnvironmentName}-#{export}-#{safe_bucket_name}-origin-access-identity")
end
end

Expand Down

0 comments on commit 6ae8486

Please sign in to comment.