From b220812e563db0f04fe7f470e69ce768fb436c47 Mon Sep 17 00:00:00 2001 From: Karl Girthofer Date: Wed, 9 Aug 2017 18:55:51 -0400 Subject: [PATCH 1/2] Delete terraform.tfstate --- terraform.tfstate | 291 ---------------------------------------------- 1 file changed, 291 deletions(-) delete mode 100644 terraform.tfstate diff --git a/terraform.tfstate b/terraform.tfstate deleted file mode 100644 index 8223a1a..0000000 --- a/terraform.tfstate +++ /dev/null @@ -1,291 +0,0 @@ -{ - "version": 3, - "terraform_version": "0.9.3", - "serial": 13, - "lineage": "d343843c-2585-4310-bf2a-028af066cffd", - "modules": [ - { - "path": [ - "root" - ], - "outputs": {}, - "resources": { - "aws_cloudwatch_event_rule.scale_down": { - "type": "aws_cloudwatch_event_rule", - "depends_on": [], - "primary": { - "id": "test-cluster-asg-scale-down", - "attributes": { - "arn": "arn:aws:events:us-east-1:647956677678:rule/test-cluster-asg-scale-down", - "description": "Capture each scale down", - "event_pattern": "{\"detail\":{\"AutoScalingGroupName\":[\"asgtestContainerInstance\"]},\"detail-type\":[\"EC2 Instance Terminate Successful\"],\"source\":[\"aws.autoscaling\"]}", - "id": "test-cluster-asg-scale-down", - "is_enabled": "true", - "name": "test-cluster-asg-scale-down", - "role_arn": "", - "schedule_expression": "" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_cloudwatch_event_rule.scale_up": { - "type": "aws_cloudwatch_event_rule", - "depends_on": [], - "primary": { - "id": "test-cluster-asg-scale-up", - "attributes": { - "arn": "arn:aws:events:us-east-1:647956677678:rule/test-cluster-asg-scale-up", - "description": "Capture each scale up", - "event_pattern": "{\"detail\":{\"AutoScalingGroupName\":[\"asgtestContainerInstance\"]},\"detail-type\":[\"EC2 Instance Launch Successful\"],\"source\":[\"aws.autoscaling\"]}", - "id": "test-cluster-asg-scale-up", - "is_enabled": "true", - "name": "test-cluster-asg-scale-up", - "role_arn": "", - "schedule_expression": "" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_cloudwatch_event_target.lambdaTriggerDown": { - "type": "aws_cloudwatch_event_target", - "depends_on": [ - "aws_cloudwatch_event_rule.scale_down", - "aws_lambda_function.lambda_shuffler" - ], - "primary": { - "id": "test-cluster-asg-scale-down-lamdaFunction", - "attributes": { - "arn": "arn:aws:lambda:us-east-1:647956677678:function:test-shuffler", - "id": "test-cluster-asg-scale-down-lamdaFunction", - "input": "", - "input_path": "", - "rule": "test-cluster-asg-scale-down", - "target_id": "lamdaFunction" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_cloudwatch_event_target.lambdaTriggerUp": { - "type": "aws_cloudwatch_event_target", - "depends_on": [ - "aws_cloudwatch_event_rule.scale_up", - "aws_lambda_function.lambda_shuffler" - ], - "primary": { - "id": "test-cluster-asg-scale-up-lamdaFunction", - "attributes": { - "arn": "arn:aws:lambda:us-east-1:647956677678:function:test-shuffler", - "id": "test-cluster-asg-scale-up-lamdaFunction", - "input": "", - "input_path": "", - "rule": "test-cluster-asg-scale-up", - "target_id": "lamdaFunction" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_iam_policy.cloudwatchAccess": { - "type": "aws_iam_policy", - "depends_on": [ - "data.aws_iam_policy_document.cloudwatchAccess" - ], - "primary": { - "id": "arn:aws:iam::647956677678:policy/test-shuffler-policy", - "attributes": { - "arn": "arn:aws:iam::647956677678:policy/test-shuffler-policy", - "id": "arn:aws:iam::647956677678:policy/test-shuffler-policy", - "name": "test-shuffler-policy", - "path": "/", - "policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"1\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"logs:PutLogEvents\",\n \"logs:CreateLogStream\",\n \"logs:CreateLogGroup\"\n ],\n \"Resource\": \"arn:aws:logs:*:*:*\"\n },\n {\n \"Sid\": \"2\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"ecs:UpdateService\",\n \"ecs:DescribeServices\",\n \"autoscaling:DescribeAutoScalingGroups\"\n ],\n \"Resource\": \"*\"\n }\n ]\n}" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_iam_policy_attachment.test-attach": { - "type": "aws_iam_policy_attachment", - "depends_on": [ - "aws_iam_policy.cloudwatchAccess", - "aws_iam_role.lambda_shuffler_role" - ], - "primary": { - "id": "ecs-attachment", - "attributes": { - "groups.#": "0", - "id": "ecs-attachment", - "name": "ecs-attachment", - "policy_arn": "arn:aws:iam::647956677678:policy/test-shuffler-policy", - "roles.#": "1", - "roles.2740684834": "test-shuffler_role", - "users.#": "0" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_iam_role.lambda_shuffler_role": { - "type": "aws_iam_role", - "depends_on": [], - "primary": { - "id": "test-shuffler_role", - "attributes": { - "arn": "arn:aws:iam::647956677678:role/test-shuffler_role", - "assume_role_policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"lambda.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}", - "create_date": "2017-08-09T15:43:39Z", - "id": "test-shuffler_role", - "name": "test-shuffler_role", - "path": "/", - "unique_id": "AROAIHHIJIPSQNCHDKHB2" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_lambda_function.lambda_shuffler": { - "type": "aws_lambda_function", - "depends_on": [ - "aws_iam_role.lambda_shuffler_role" - ], - "primary": { - "id": "test-shuffler", - "attributes": { - "arn": "arn:aws:lambda:us-east-1:647956677678:function:test-shuffler", - "dead_letter_config.#": "0", - "description": "", - "environment.#": "1", - "environment.0.variables.%": "2", - "environment.0.variables.ASG_NAME": "asgtestContainerInstance", - "environment.0.variables.CLUSTER_NAME": "test-cluster", - "filename": "shuffler.zip", - "function_name": "test-shuffler", - "handler": "shuffler.lambda_handler", - "id": "test-shuffler", - "kms_key_arn": "", - "last_modified": "2017-08-09T20:41:43.831+0000", - "memory_size": "128", - "publish": "false", - "qualified_arn": "arn:aws:lambda:us-east-1:647956677678:function:test-shuffler:$LATEST", - "role": "arn:aws:iam::647956677678:role/test-shuffler_role", - "runtime": "python2.7", - "source_code_hash": "lGxYQNYTqg//K63M3eFD7Ziwfeu15LfktRbHnnrYGTg=", - "timeout": "3", - "version": "$LATEST", - "vpc_config.#": "0" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_lambda_permission.allow_cloudwatch_down": { - "type": "aws_lambda_permission", - "depends_on": [ - "aws_cloudwatch_event_rule.scale_down", - "aws_lambda_function.lambda_shuffler" - ], - "primary": { - "id": "AllowExecutionFromCloudWatchDown", - "attributes": { - "action": "lambda:InvokeFunction", - "function_name": "test-shuffler", - "id": "AllowExecutionFromCloudWatchDown", - "principal": "events.amazonaws.com", - "qualifier": "", - "source_arn": "arn:aws:events:us-east-1:647956677678:rule/test-cluster-asg-scale-down", - "statement_id": "AllowExecutionFromCloudWatchDown" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_lambda_permission.allow_cloudwatch_up": { - "type": "aws_lambda_permission", - "depends_on": [ - "aws_cloudwatch_event_rule.scale_up", - "aws_lambda_function.lambda_shuffler" - ], - "primary": { - "id": "AllowExecutionFromCloudWatchUp", - "attributes": { - "action": "lambda:InvokeFunction", - "function_name": "test-shuffler", - "id": "AllowExecutionFromCloudWatchUp", - "principal": "events.amazonaws.com", - "qualifier": "", - "source_arn": "arn:aws:events:us-east-1:647956677678:rule/test-cluster-asg-scale-up", - "statement_id": "AllowExecutionFromCloudWatchUp" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "data.aws_iam_policy_document.cloudwatchAccess": { - "type": "aws_iam_policy_document", - "depends_on": [], - "primary": { - "id": "1236859912", - "attributes": { - "id": "1236859912", - "json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"1\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"logs:PutLogEvents\",\n \"logs:CreateLogStream\",\n \"logs:CreateLogGroup\"\n ],\n \"Resource\": \"arn:aws:logs:*:*:*\"\n },\n {\n \"Sid\": \"2\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"ecs:UpdateService\",\n \"ecs:DescribeServices\",\n \"autoscaling:DescribeAutoScalingGroups\"\n ],\n \"Resource\": \"*\"\n }\n ]\n}", - "statement.#": "2", - "statement.0.actions.#": "3", - "statement.0.actions.2809485102": "logs:CreateLogGroup", - "statement.0.actions.3285979848": "logs:CreateLogStream", - "statement.0.actions.39743051": "logs:PutLogEvents", - "statement.0.condition.#": "0", - "statement.0.effect": "Allow", - "statement.0.not_actions.#": "0", - "statement.0.not_principals.#": "0", - "statement.0.not_resources.#": "0", - "statement.0.principals.#": "0", - "statement.0.resources.#": "1", - "statement.0.resources.162423377": "arn:aws:logs:*:*:*", - "statement.0.sid": "1", - "statement.1.actions.#": "3", - "statement.1.actions.1274732150": "autoscaling:DescribeAutoScalingGroups", - "statement.1.actions.2086247879": "ecs:DescribeServices", - "statement.1.actions.3291873882": "ecs:UpdateService", - "statement.1.condition.#": "0", - "statement.1.effect": "Allow", - "statement.1.not_actions.#": "0", - "statement.1.not_principals.#": "0", - "statement.1.not_resources.#": "0", - "statement.1.principals.#": "0", - "statement.1.resources.#": "1", - "statement.1.resources.2679715827": "*", - "statement.1.sid": "2" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - } - }, - "depends_on": [] - } - ] -} From cb8ce6b1a1641c6622fd1cd6b5582f68399dd7da Mon Sep 17 00:00:00 2001 From: Karl Girthofer Date: Wed, 9 Aug 2017 18:56:00 -0400 Subject: [PATCH 2/2] Delete terraform.tfstate.backup --- terraform.tfstate.backup | 291 --------------------------------------- 1 file changed, 291 deletions(-) delete mode 100644 terraform.tfstate.backup diff --git a/terraform.tfstate.backup b/terraform.tfstate.backup deleted file mode 100644 index 710d412..0000000 --- a/terraform.tfstate.backup +++ /dev/null @@ -1,291 +0,0 @@ -{ - "version": 3, - "terraform_version": "0.9.3", - "serial": 12, - "lineage": "d343843c-2585-4310-bf2a-028af066cffd", - "modules": [ - { - "path": [ - "root" - ], - "outputs": {}, - "resources": { - "aws_cloudwatch_event_rule.scale_down": { - "type": "aws_cloudwatch_event_rule", - "depends_on": [], - "primary": { - "id": "test-cluster-asg-scale-down", - "attributes": { - "arn": "arn:aws:events:us-east-1:647956677678:rule/test-cluster-asg-scale-down", - "description": "Capture each scale down", - "event_pattern": "{\"detail\":{\"AutoScalingGroupName\":[\"ecs-staging-cluster-asg\"]},\"detail-type\":[\"EC2 Instance Terminate Successful\"],\"source\":[\"aws.autoscaling\"]}", - "id": "test-cluster-asg-scale-down", - "is_enabled": "true", - "name": "test-cluster-asg-scale-down", - "role_arn": "", - "schedule_expression": "" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_cloudwatch_event_rule.scale_up": { - "type": "aws_cloudwatch_event_rule", - "depends_on": [], - "primary": { - "id": "test-cluster-asg-scale-up", - "attributes": { - "arn": "arn:aws:events:us-east-1:647956677678:rule/test-cluster-asg-scale-up", - "description": "Capture each scale up", - "event_pattern": "{\"detail\":{\"AutoScalingGroupName\":[\"asgtestContainerInstance\"]},\"detail-type\":[\"EC2 Instance Launch Successful\"],\"source\":[\"aws.autoscaling\"]}", - "id": "test-cluster-asg-scale-up", - "is_enabled": "true", - "name": "test-cluster-asg-scale-up", - "role_arn": "", - "schedule_expression": "" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_cloudwatch_event_target.lambdaTriggerDown": { - "type": "aws_cloudwatch_event_target", - "depends_on": [ - "aws_cloudwatch_event_rule.scale_down", - "aws_lambda_function.lambda_shuffler" - ], - "primary": { - "id": "test-cluster-asg-scale-down-lamdaFunction", - "attributes": { - "arn": "arn:aws:lambda:us-east-1:647956677678:function:test-shuffler", - "id": "test-cluster-asg-scale-down-lamdaFunction", - "input": "", - "input_path": "", - "rule": "test-cluster-asg-scale-down", - "target_id": "lamdaFunction" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_cloudwatch_event_target.lambdaTriggerUp": { - "type": "aws_cloudwatch_event_target", - "depends_on": [ - "aws_cloudwatch_event_rule.scale_up", - "aws_lambda_function.lambda_shuffler" - ], - "primary": { - "id": "test-cluster-asg-scale-up-lamdaFunction", - "attributes": { - "arn": "arn:aws:lambda:us-east-1:647956677678:function:test-shuffler", - "id": "test-cluster-asg-scale-up-lamdaFunction", - "input": "", - "input_path": "", - "rule": "test-cluster-asg-scale-up", - "target_id": "lamdaFunction" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_iam_policy.cloudwatchAccess": { - "type": "aws_iam_policy", - "depends_on": [ - "data.aws_iam_policy_document.cloudwatchAccess" - ], - "primary": { - "id": "arn:aws:iam::647956677678:policy/test-shuffler-policy", - "attributes": { - "arn": "arn:aws:iam::647956677678:policy/test-shuffler-policy", - "id": "arn:aws:iam::647956677678:policy/test-shuffler-policy", - "name": "test-shuffler-policy", - "path": "/", - "policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"1\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"logs:PutLogEvents\",\n \"logs:CreateLogStream\",\n \"logs:CreateLogGroup\"\n ],\n \"Resource\": \"arn:aws:logs:*:*:*\"\n },\n {\n \"Sid\": \"2\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"ecs:UpdateService\",\n \"ecs:DescribeServices\",\n \"autoscaling:DescribeAutoScalingGroups\"\n ],\n \"Resource\": \"*\"\n }\n ]\n}" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_iam_policy_attachment.test-attach": { - "type": "aws_iam_policy_attachment", - "depends_on": [ - "aws_iam_policy.cloudwatchAccess", - "aws_iam_role.lambda_shuffler_role" - ], - "primary": { - "id": "ecs-attachment", - "attributes": { - "groups.#": "0", - "id": "ecs-attachment", - "name": "ecs-attachment", - "policy_arn": "arn:aws:iam::647956677678:policy/test-shuffler-policy", - "roles.#": "1", - "roles.2740684834": "test-shuffler_role", - "users.#": "0" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_iam_role.lambda_shuffler_role": { - "type": "aws_iam_role", - "depends_on": [], - "primary": { - "id": "test-shuffler_role", - "attributes": { - "arn": "arn:aws:iam::647956677678:role/test-shuffler_role", - "assume_role_policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"lambda.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}", - "create_date": "2017-08-09T15:43:39Z", - "id": "test-shuffler_role", - "name": "test-shuffler_role", - "path": "/", - "unique_id": "AROAIHHIJIPSQNCHDKHB2" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_lambda_function.lambda_shuffler": { - "type": "aws_lambda_function", - "depends_on": [ - "aws_iam_role.lambda_shuffler_role" - ], - "primary": { - "id": "test-shuffler", - "attributes": { - "arn": "arn:aws:lambda:us-east-1:647956677678:function:test-shuffler", - "dead_letter_config.#": "0", - "description": "", - "environment.#": "1", - "environment.0.variables.%": "2", - "environment.0.variables.ASG_NAME": "asgtestContainerInstance", - "environment.0.variables.CLUSTER_NAME": "test-cluster", - "filename": "shuffler.zip", - "function_name": "test-shuffler", - "handler": "shuffler.lambda_handler", - "id": "test-shuffler", - "kms_key_arn": "", - "last_modified": "2017-08-09T20:41:43.831+0000", - "memory_size": "128", - "publish": "false", - "qualified_arn": "arn:aws:lambda:us-east-1:647956677678:function:test-shuffler:$LATEST", - "role": "arn:aws:iam::647956677678:role/test-shuffler_role", - "runtime": "python2.7", - "source_code_hash": "lGxYQNYTqg//K63M3eFD7Ziwfeu15LfktRbHnnrYGTg=", - "timeout": "3", - "version": "$LATEST", - "vpc_config.#": "0" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_lambda_permission.allow_cloudwatch_down": { - "type": "aws_lambda_permission", - "depends_on": [ - "aws_cloudwatch_event_rule.scale_down", - "aws_lambda_function.lambda_shuffler" - ], - "primary": { - "id": "AllowExecutionFromCloudWatchDown", - "attributes": { - "action": "lambda:InvokeFunction", - "function_name": "test-shuffler", - "id": "AllowExecutionFromCloudWatchDown", - "principal": "events.amazonaws.com", - "qualifier": "", - "source_arn": "arn:aws:events:us-east-1:647956677678:rule/test-cluster-asg-scale-down", - "statement_id": "AllowExecutionFromCloudWatchDown" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "aws_lambda_permission.allow_cloudwatch_up": { - "type": "aws_lambda_permission", - "depends_on": [ - "aws_cloudwatch_event_rule.scale_up", - "aws_lambda_function.lambda_shuffler" - ], - "primary": { - "id": "AllowExecutionFromCloudWatchUp", - "attributes": { - "action": "lambda:InvokeFunction", - "function_name": "test-shuffler", - "id": "AllowExecutionFromCloudWatchUp", - "principal": "events.amazonaws.com", - "qualifier": "", - "source_arn": "arn:aws:events:us-east-1:647956677678:rule/test-cluster-asg-scale-up", - "statement_id": "AllowExecutionFromCloudWatchUp" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - }, - "data.aws_iam_policy_document.cloudwatchAccess": { - "type": "aws_iam_policy_document", - "depends_on": [], - "primary": { - "id": "1236859912", - "attributes": { - "id": "1236859912", - "json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"1\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"logs:PutLogEvents\",\n \"logs:CreateLogStream\",\n \"logs:CreateLogGroup\"\n ],\n \"Resource\": \"arn:aws:logs:*:*:*\"\n },\n {\n \"Sid\": \"2\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"ecs:UpdateService\",\n \"ecs:DescribeServices\",\n \"autoscaling:DescribeAutoScalingGroups\"\n ],\n \"Resource\": \"*\"\n }\n ]\n}", - "statement.#": "2", - "statement.0.actions.#": "3", - "statement.0.actions.2809485102": "logs:CreateLogGroup", - "statement.0.actions.3285979848": "logs:CreateLogStream", - "statement.0.actions.39743051": "logs:PutLogEvents", - "statement.0.condition.#": "0", - "statement.0.effect": "Allow", - "statement.0.not_actions.#": "0", - "statement.0.not_principals.#": "0", - "statement.0.not_resources.#": "0", - "statement.0.principals.#": "0", - "statement.0.resources.#": "1", - "statement.0.resources.162423377": "arn:aws:logs:*:*:*", - "statement.0.sid": "1", - "statement.1.actions.#": "3", - "statement.1.actions.1274732150": "autoscaling:DescribeAutoScalingGroups", - "statement.1.actions.2086247879": "ecs:DescribeServices", - "statement.1.actions.3291873882": "ecs:UpdateService", - "statement.1.condition.#": "0", - "statement.1.effect": "Allow", - "statement.1.not_actions.#": "0", - "statement.1.not_principals.#": "0", - "statement.1.not_resources.#": "0", - "statement.1.principals.#": "0", - "statement.1.resources.#": "1", - "statement.1.resources.2679715827": "*", - "statement.1.sid": "2" - }, - "meta": {}, - "tainted": false - }, - "deposed": [], - "provider": "" - } - }, - "depends_on": [] - } - ] -}