Skip to content

Commit

Permalink
fix: permissions for destination bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
roleyfoley committed Feb 22, 2021
1 parent 86685d4 commit 6c5c49f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions hamlet/s3support/extensions/s3_inventory_copy_batch/extension.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,29 @@
[/#if]
[/#if]

[#local destinationBucketLink = _context.Links["DESTINATION_BUCKET"]]
[#local policyS3DestinationPrefix = s3DestinationPrefix?has_content?then(s3DestinationPrefix, "*" )?remove_ending("/") ]

[#if destinationBucketLink?has_content ]
[#local destinationBaselineLinks = getBaselineLinks(destinationBucketLink, ["Encryption" ] )]
[#local destinationBaselineComponentIds = getBaselineComponentIds(destinationBaselineLinks)]
[#local destinationKmsKeyId = destinationBaselineComponentIds["Encryption"]]

[#if (destinationBucketLink.Configuration.Solution.Encryption.Enabled)!false ]
[@Policy
s3EncryptionAllPermission(
destinationKmsKeyId,
destinationBucketLink.State.Attributes["NAME"],
policyS3DestinationPrefix,
destinationBucketLink.State.Attributes["REGION"]
)
/]
[/#if]

[@Policy
s3ProducePermission(destinationBucketLink.State.Attributes["NAME"], policyS3DestinationPrefix)
/]
[/#if]

[@Settings
[
Expand Down

0 comments on commit 6c5c49f

Please sign in to comment.