Skip to content

Commit

Permalink
Destroy all resources
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklaw5 committed Apr 6, 2020
1 parent 1f7262f commit ebc6127
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 176 deletions.
2 changes: 0 additions & 2 deletions README.md
@@ -1,7 +1,5 @@
# stack-1

Visit http://demo.nicholaslaw.com.au/ for working demo.

See these repos also:

- Stack 2 - https://github.com/nicklaw5/stack-2
Expand Down
13 changes: 13 additions & 0 deletions scripts/terraform_destroy.sh
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -euo pipefail

docker run --rm \
--user $(id -u) \
--env AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY \
--env TF_VAR_aws_region=${AWS_DEFAULT_REGION} \
--volume ${PWD}/${TERRAFORM_DIR}:/app \
--workdir /app \
hashicorp/terraform:${TERRAFORM_VERSION} \
destroy -auto-approve
176 changes: 2 additions & 174 deletions terraform/terraform.tfstate
@@ -1,180 +1,8 @@
{
"version": 4,
"terraform_version": "0.12.23",
"serial": 22,
"serial": 29,
"lineage": "79d7c418-b396-b6d8-f333-57236b7ed1a3",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "aws_dynamodb_table",
"name": "tf_state_table",
"provider": "provider.aws",
"instances": [
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:dynamodb:ap-southeast-2:307055745072:table/tf-state-table",
"attribute": [
{
"name": "LockID",
"type": "S"
}
],
"billing_mode": "PAY_PER_REQUEST",
"global_secondary_index": [],
"hash_key": "LockID",
"id": "tf-state-table",
"local_secondary_index": [],
"name": "tf-state-table",
"point_in_time_recovery": [
{
"enabled": false
}
],
"range_key": null,
"read_capacity": 0,
"server_side_encryption": [],
"stream_arn": "",
"stream_enabled": false,
"stream_label": "",
"stream_view_type": "",
"tags": {
"ManagedBy": "terraform",
"Name": "tf-state-table",
"Repository": "stack-1"
},
"timeouts": null,
"ttl": [
{
"attribute_name": "",
"enabled": false
}
],
"write_capacity": 0
},
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjM2MDAwMDAwMDAwMDB9LCJzY2hlbWFfdmVyc2lvbiI6IjEifQ=="
}
]
},
{
"mode": "managed",
"type": "aws_s3_bucket",
"name": "tf_state_artifacts_bucket",
"provider": "provider.aws",
"instances": [
{
"schema_version": 0,
"attributes": {
"acceleration_status": "",
"acl": "private",
"arn": "arn:aws:s3:::tf-state-artifacts-bucket",
"bucket": "tf-state-artifacts-bucket",
"bucket_domain_name": "tf-state-artifacts-bucket.s3.amazonaws.com",
"bucket_prefix": null,
"bucket_regional_domain_name": "tf-state-artifacts-bucket.s3.ap-southeast-2.amazonaws.com",
"cors_rule": [],
"force_destroy": false,
"grant": [],
"hosted_zone_id": "Z1WCIGYICN2BYD",
"id": "tf-state-artifacts-bucket",
"lifecycle_rule": [],
"logging": [],
"object_lock_configuration": [],
"policy": null,
"region": "ap-southeast-2",
"replication_configuration": [],
"request_payer": "BucketOwner",
"server_side_encryption_configuration": [
{
"rule": [
{
"apply_server_side_encryption_by_default": [
{
"kms_master_key_id": "",
"sse_algorithm": "AES256"
}
]
}
]
}
],
"tags": {
"ManagedBy": "terraform",
"Name": "tf-state-artifacts-bucket",
"Repository": "stack-1"
},
"versioning": [
{
"enabled": true,
"mfa_delete": false
}
],
"website": [],
"website_domain": null,
"website_endpoint": null
},
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "aws_ssm_parameter",
"name": "terraform_lock_table",
"provider": "provider.aws",
"instances": [
{
"schema_version": 0,
"attributes": {
"allowed_pattern": "",
"arn": "arn:aws:ssm:ap-southeast-2:307055745072:parameter/stack-1/terraform_lock_table",
"description": "",
"id": "/stack-1/terraform_lock_table",
"key_id": "",
"name": "/stack-1/terraform_lock_table",
"overwrite": true,
"tags": {},
"tier": "Standard",
"type": "String",
"value": "tf-state-table",
"version": 2
},
"private": "bnVsbA==",
"dependencies": [
"aws_dynamodb_table.tf_state_table"
]
}
]
},
{
"mode": "managed",
"type": "aws_ssm_parameter",
"name": "terraform_state_bucket",
"provider": "provider.aws",
"instances": [
{
"schema_version": 0,
"attributes": {
"allowed_pattern": "",
"arn": "arn:aws:ssm:ap-southeast-2:307055745072:parameter/stack-1/terraform_state_bucket",
"description": "",
"id": "/stack-1/terraform_state_bucket",
"key_id": "",
"name": "/stack-1/terraform_state_bucket",
"overwrite": true,
"tags": {},
"tier": "Standard",
"type": "String",
"value": "tf-state-artifacts-bucket",
"version": 2
},
"private": "bnVsbA==",
"dependencies": [
"aws_s3_bucket.tf_state_artifacts_bucket"
]
}
]
}
]
"resources": []
}

0 comments on commit ebc6127

Please sign in to comment.