Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
arti-shalb committed Apr 27, 2021
1 parent 63f70e8 commit 4c6b480
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
14 changes: 14 additions & 0 deletions s3-bucket/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
variable "name" {
type = string
}

resource "aws_s3_bucket" "cdevautotests" {
bucket = var.name
tags = {
Name = "Cdev auto tests bucket"
}
}

output "id" {
value = aws_s3_bucket.cdevautotests.id
}
11 changes: 11 additions & 0 deletions s3-file/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "bucket_name" {
type = string
}

resource "aws_s3_bucket_object" "cdev_object" {
key = "s3file.txt"
bucket = var.bucket_name
source = "${path.module}/s3file.txt"

force_destroy = true
}
1 change: 1 addition & 0 deletions s3-file/s3file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
File will be uploaded to s3 bucket.
25 changes: 25 additions & 0 deletions template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: cdev-tests
kind: InfraTemplate
modules:
-
name: create-bucket
type: terraform
source: github.com/shalb/cdev-test-template//s3-bucket/
pre_hook:
command: echo "check cdev hook"
on_destroy: true
on_plan: true
inputs:
name: {{ .name }}
-
name: create-s3-object
type: terraform
source: ./s3-file/
inputs:
bucket_name: {{ remoteState "this.create-bucket.id" }}
-
name: print_outputs
type: printer
depends_on: this.create-s3-object
inputs:
bucket_name: Bucket name is {{ remoteState "this.create-bucket.id" }}

0 comments on commit 4c6b480

Please sign in to comment.