This file contains hidden or 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
require './spec_helper' | |
bucket_policy = JSON.parse(File.open("../../policies/bucket.json").read) | |
describe s3_bucket(@bucket_name) do | |
it { should exist } | |
its(:acl_grants_count) { should eq 1 } | |
its('policy.policy.read') { should include bucket_policy['Statement'][0]['Sid'] } | |
its('policy.policy.read') { should include bucket_policy['Statement'][0]['Action'][0] } | |
its('policy.policy.read') { should include bucket_policy['Statement'][0]['Resource'][0] } |
This file contains hidden or 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
package test | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"os/exec" | |
"strings" |
This file contains hidden or 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
{ | |
"Version": "2012-10-17", | |
"Id": "MyBucketPolicy", | |
"Statement": [ | |
{ | |
"Sid": "AllowWriteUser", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "arn:aws:iam::REDACTED:user/MyBucketWriteUser" | |
}, |
This file contains hidden or 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
{ | |
"Version": "2012-10-17", | |
"Id": "MyBucketPolicy", | |
"Statement": [ | |
{ | |
"Sid": "AllowWriteUser", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "arn:aws:iam::REDACTED:user/MyBucketWriteUser" | |
}, |
This file contains hidden or 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
package test | |
import ( | |
"fmt" | |
"testing" | |
"github.com/stretchr/testify/assert" | |
) | |
const BucketPolicyFilePath = "../../policies/bucket.json" |
This file contains hidden or 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
{ | |
"Version": "2012-10-17", | |
"Id": "MyBucketPolicy", | |
"Statement": [ | |
{ | |
"Sid": "AllowWriteUser", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "arn:aws:iam::AccountID:user/test" | |
}, |
This file contains hidden or 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
package test | |
import ( | |
"testing" | |
"github.com/stretchr/testify/assert" | |
) | |
const BucketPolicyFilePath = "../../policies/bucket.json" |
This file contains hidden or 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
--- | |
apiVersion: "hello-stateful.example.com/v1alpha1" | |
kind: "HelloStateful" | |
metadata: | |
name: "new-hello-stateful" | |
spec: | |
replicas: 1 | |
restoreFromExisting: true | |
backupSchedule: "*/5 * * * *" |
This file contains hidden or 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
--- | |
apiVersion: "hello-stateful.example.com/v1alpha1" | |
kind: "HelloStateful" | |
metadata: | |
name: "new-hello-stateful" | |
spec: | |
replicas: 1 | |
restoreFromExisting: false | |
backupSchedule: "*/5 * * * *" |
This file contains hidden or 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
--- | |
kind: Role | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
metadata: | |
name: hello-stateful-operator | |
rules: | |
- apiGroups: | |
- hello-stateful.example.com | |
resources: | |
- "*" |