-
-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert to TF 0.12. Add tests. Add Codefresh test pipeline (#13)
* Convert to TF 0.12. Add tests. Add Codefresh test pipeline * Update outputs
- Loading branch information
Showing
24 changed files
with
560 additions
and
189 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 was deleted.
Oops, something went wrong.
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
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,74 @@ | ||
version: '1.0' | ||
|
||
stages: | ||
- Prepare | ||
- Test | ||
|
||
steps: | ||
wait: | ||
title: Wait | ||
stage: Prepare | ||
image: codefresh/cli:latest | ||
commands: | ||
- codefresh get builds --pipeline=${{CF_REPO_NAME}} --status running --limit 1000 -o json | jq --arg id ${{CF_BUILD_ID}} -ser 'flatten|.[-1].id==$id' | ||
retry: | ||
maxAttempts: 10 | ||
delay: 20 | ||
exponentialFactor: 1.1 | ||
|
||
main_clone: | ||
title: "Clone repository" | ||
type: git-clone | ||
stage: Prepare | ||
description: "Initialize" | ||
repo: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}} | ||
git: CF-default | ||
revision: ${{CF_REVISION}} | ||
|
||
clean_init: | ||
title: Prepare build-harness and test-harness | ||
image: ${{TEST_IMAGE}} | ||
stage: Prepare | ||
commands: | ||
- cf_export PATH="/usr/local/terraform/0.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
- make init | ||
- git -C build-harness checkout master | ||
- make -C test/ clean init TEST_HARNESS_BRANCH=master | ||
- make -C test/src clean init | ||
- find . -type d -name '.terraform' | xargs rm -rf | ||
- find . -type f -name 'terraform.tfstate*' -exec rm -f {} \; | ||
|
||
test: | ||
type: "parallel" | ||
title: "Run tests" | ||
description: "Run all tests in parallel" | ||
stage: Test | ||
steps: | ||
test_readme_lint: | ||
title: "Test README.md updated" | ||
stage: "Test" | ||
image: ${{TEST_IMAGE}} | ||
description: Test "readme/lint" | ||
commands: | ||
- make readme/lint | ||
|
||
test_module: | ||
title: Test module with bats | ||
image: ${{TEST_IMAGE}} | ||
stage: Test | ||
commands: | ||
- make -C test/ module | ||
|
||
test_examples_complete: | ||
title: Test "examples/complete" with bats | ||
image: ${{TEST_IMAGE}} | ||
stage: Test | ||
commands: | ||
- make -C test/ examples/complete | ||
|
||
test_examples_complete_terratest: | ||
title: Test "examples/complete" with terratest | ||
image: ${{TEST_IMAGE}} | ||
stage: Test | ||
commands: | ||
- make -C test/src |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
region = "us-west-1" | ||
|
||
namespace = "eg" | ||
|
||
stage = "test" | ||
|
||
name = "s3-test" | ||
|
||
acl = "private" | ||
|
||
force_destroy = true | ||
|
||
versioning_enabled = false | ||
|
||
allow_encrypted_uploads_only = true | ||
|
||
allowed_bucket_actions = ["s3:PutObject", "s3:PutObjectAcl", "s3:GetObject", "s3:DeleteObject", "s3:ListBucket", "s3:ListBucketMultipartUploads", "s3:GetBucketLocation", "s3:AbortMultipartUpload"] |
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,19 @@ | ||
provider "aws" { | ||
region = var.region | ||
} | ||
|
||
module "s3_bucket" { | ||
source = "../../" | ||
|
||
enabled = true | ||
user_enabled = true | ||
region = var.region | ||
namespace = var.namespace | ||
stage = var.stage | ||
name = var.name | ||
acl = var.acl | ||
force_destroy = var.force_destroy | ||
versioning_enabled = var.versioning_enabled | ||
allow_encrypted_uploads_only = var.allow_encrypted_uploads_only | ||
allowed_bucket_actions = var.allowed_bucket_actions | ||
} |
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,29 @@ | ||
output "bucket_domain_name" { | ||
value = module.s3_bucket.bucket_domain_name | ||
description = "FQDN of bucket" | ||
} | ||
|
||
output "bucket_id" { | ||
value = module.s3_bucket.bucket_id | ||
description = "Bucket Name (aka ID)" | ||
} | ||
|
||
output "bucket_arn" { | ||
value = module.s3_bucket.bucket_arn | ||
description = "Bucket ARN" | ||
} | ||
|
||
output "user_name" { | ||
value = module.s3_bucket.user_name | ||
description = "Normalized IAM user name" | ||
} | ||
|
||
output "user_arn" { | ||
value = module.s3_bucket.user_arn | ||
description = "The ARN assigned by AWS for the user" | ||
} | ||
|
||
output "user_unique_id" { | ||
value = module.s3_bucket.user_unique_id | ||
description = "The user unique ID assigned by AWS" | ||
} |
Oops, something went wrong.