forked from theonestack/hl-component-s3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: optionally enable bucket ACL for cloudfront logging bucket
- Loading branch information
1 parent
76bd80d
commit 2745d95
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
require 'yaml' | ||
|
||
describe 'compiled component s3' do | ||
|
||
context 'cftest' do | ||
it 'compiles test' do | ||
expect(system("cfhighlander cftest #{@validate} --tests tests/acl.test.yaml")).to be_truthy | ||
end | ||
end | ||
|
||
let(:template) { YAML.load_file("#{File.dirname(__FILE__)}/../out/tests/acl/s3.compiled.yaml") } | ||
|
||
context "Resource" do | ||
|
||
|
||
context "Normalbucket" do | ||
let(:resource) { template["Resources"]["Normalbucket"] } | ||
|
||
it "is of type AWS::S3::Bucket" do | ||
expect(resource["Type"]).to eq("AWS::S3::Bucket") | ||
end | ||
|
||
it "to have property BucketName" do | ||
expect(resource["Properties"]["BucketName"]).to eq({"Fn::Sub"=>"normal-bucket"}) | ||
end | ||
|
||
it "to have property Tags" do | ||
expect(resource["Properties"]["Tags"]).to eq([{"Key"=>"Name", "Value"=>{"Fn::Sub"=>"${EnvironmentName}-normal-bucket"}}, {"Key"=>"Environment", "Value"=>{"Ref"=>"EnvironmentName"}}, {"Key"=>"EnvironmentType", "Value"=>{"Ref"=>"EnvironmentType"}}]) | ||
end | ||
|
||
it "to have property OwnershipControls" do | ||
expect(resource["Properties"]["OwnershipControls"]).to eq({"Rules"=>[{"ObjectOwnership"=>"ObjectWriter"}]}) | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
test_metadata: | ||
type: config | ||
name: acl | ||
description: set the description for your test | ||
|
||
# Insert your tests here | ||
buckets: | ||
normal-bucket: | ||
type: default | ||
acl_rules: | ||
- ObjectWriter |