Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
eddycharly committed Sep 27, 2023
0 parents commit 6bd0976
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# tf-kyverno

```console
# create a plan
terraform plan -out=tf.plan

# show plan in json
terraform show -json tf.plan > tf.plan.json
```
16 changes: 16 additions & 0 deletions policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: tf.kyverno.io/v1
kind: Policy
metadata:
name: require-label
spec:
rules:
- name: require-label
match:
any:
- type: aws_s3_bucket
validate:
message: 'A team tag is required for all S3 buckets'
pattern:
values:
tags:
team: ?*
17 changes: 17 additions & 0 deletions s3.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
provider "aws" {
region = "eu-west-1"
skip_credentials_validation = true
skip_requesting_account_id = true
skip_metadata_api_check = true
access_key = "mock_access_key"
secret_key = "mock_secret_key"
}

resource "aws_s3_bucket" "example" {
bucket = "my-tf-test-bucket"

tags = {
Name = "My bucket"
Environment = "Dev"
}
}

0 comments on commit 6bd0976

Please sign in to comment.