diff options
-rw-r--r-- | terraform/.terraform.tfstate.lock.info | 1 | ||||
-rw-r--r-- | terraform/ami.tf | 10 | ||||
-rw-r--r-- | terraform/asg.tf | 52 | ||||
-rw-r--r-- | terraform/config_map_aws_auth.yaml | 15 | ||||
-rw-r--r-- | terraform/kubeconfig.tf | 58 | ||||
-rw-r--r-- | terraform/terraform.tfstate.backup | 689 |
6 files changed, 821 insertions, 4 deletions
diff --git a/terraform/.terraform.tfstate.lock.info b/terraform/.terraform.tfstate.lock.info new file mode 100644 index 0000000..de6813e --- /dev/null +++ b/terraform/.terraform.tfstate.lock.info @@ -0,0 +1 @@ +{"ID":"e347799f-fa96-ed03-5663-aae5487d44e6","Operation":"OperationTypeApply","Info":"","Who":"hen3ry@Hen3ry-Desktop","Version":"0.11.11","Created":"2019-05-09T14:04:09.175346174Z","Path":"terraform.tfstate"}
\ No newline at end of file diff --git a/terraform/ami.tf b/terraform/ami.tf new file mode 100644 index 0000000..47dc01f --- /dev/null +++ b/terraform/ami.tf @@ -0,0 +1,10 @@ +data "aws_ami" "eks-worker" { + filter { + name = "name" + values = ["amazon-eks-node-${aws_eks_cluster.sensyne_demo_cluster.version}-v*"] + } + + most_recent = true + owners = ["602401143452"] # Amazon EKS AMI Account ID +} + diff --git a/terraform/asg.tf b/terraform/asg.tf new file mode 100644 index 0000000..8c6e7a0 --- /dev/null +++ b/terraform/asg.tf @@ -0,0 +1,52 @@ +# This data source is included for ease of sample architecture deployment +# and can be swapped out as necessary. +data "aws_region" "current" {} + +# EKS currently documents this required userdata for EKS worker nodes to +# properly configure Kubernetes applications on the EC2 instance. +# We utilize a Terraform local here to simplify Base64 encoding this +# information into the AutoScaling Launch Configuration. +# More information: https://docs.aws.amazon.com/eks/latest/userguide/launch-workers.html +locals { + demo-node-userdata = <<USERDATA +#!/bin/bash +set -o xtrace +/etc/eks/bootstrap.sh --apiserver-endpoint '${aws_eks_cluster.sensyne_demo_cluster.endpoint}' --b64-cluster-ca '${aws_eks_cluster.sensyne_demo_cluster.certificate_authority.0.data}' '${var.cluster_name}' +USERDATA +} + +resource "aws_launch_configuration" "sensyne_demo_alc" { + associate_public_ip_address = true + iam_instance_profile = "${aws_iam_instance_profile.sensyne_demo_node.name}" + image_id = "${data.aws_ami.eks-worker.id}" + instance_type = "m4.large" + name_prefix = "sensyne_demo_alc" + security_groups = ["${aws_security_group.sensyne_demo_node.id}"] + user_data_base64 = "${base64encode(local.demo-node-userdata)}" + + lifecycle { + create_before_destroy = true + } +} + +resource "aws_autoscaling_group" "sensyne_demo_asg" { + desired_capacity = 2 + launch_configuration = "${aws_launch_configuration.sensyne_demo_alc.id}" + max_size = 2 + min_size = 1 + name = "sensyne_demo_asg" + vpc_zone_identifier = ["${aws_subnet.sensyne_demo_subnet.*.id}"] + + tag { + key = "Name" + value = "sensyne_demo_asg_worker" + propagate_at_launch = true + } + + tag { + key = "kubernetes.io/cluster/${var.cluster_name}" + value = "owned" + propagate_at_launch = true + } +} + diff --git a/terraform/config_map_aws_auth.yaml b/terraform/config_map_aws_auth.yaml new file mode 100644 index 0000000..bab8bf9 --- /dev/null +++ b/terraform/config_map_aws_auth.yaml @@ -0,0 +1,15 @@ + + +apiVersion: v1 +kind: ConfigMap +metadata: + name: aws-auth + namespace: kube-system +data: + mapRoles: | + - rolearn: arn:aws:iam::375964158157:role/sensyne_demo_node + username: system:node:{{EC2PrivateDNSName}} + groups: + - system:bootstrappers + - system:nodes + diff --git a/terraform/kubeconfig.tf b/terraform/kubeconfig.tf new file mode 100644 index 0000000..7a923b6 --- /dev/null +++ b/terraform/kubeconfig.tf @@ -0,0 +1,58 @@ +locals { + kubeconfig = <<KUBECONFIG + + +apiVersion: v1 +clusters: +- cluster: + server: ${aws_eks_cluster.sensyne_demo_cluster.endpoint} + certificate-authority-data: ${aws_eks_cluster.sensyne_demo_cluster.certificate_authority.0.data} + name: kubernetes +contexts: +- context: + cluster: kubernetes + user: aws + name: aws +current-context: aws +kind: Config +preferences: {} +users: +- name: aws + user: + exec: + apiVersion: client.authentication.k8s.io/v1alpha1 + command: aws-iam-authenticator + args: + - "token" + - "-i" + - "${var.cluster_name}" +KUBECONFIG +} + +output "kubeconfig" { + value = "${local.kubeconfig}" +} + +locals { + config_map_aws_auth = <<CONFIGMAPAWSAUTH + + +apiVersion: v1 +kind: ConfigMap +metadata: + name: aws-auth + namespace: kube-system +data: + mapRoles: | + - rolearn: ${aws_iam_role.sensyne_demo_node.arn} + username: system:node:{{EC2PrivateDNSName}} + groups: + - system:bootstrappers + - system:nodes +CONFIGMAPAWSAUTH +} + +output "config_map_aws_auth" { + value = "${local.config_map_aws_auth}" +} + diff --git a/terraform/terraform.tfstate.backup b/terraform/terraform.tfstate.backup index b756843..863eefb 100644 --- a/terraform/terraform.tfstate.backup +++ b/terraform/terraform.tfstate.backup @@ -1,15 +1,292 @@ { "version": 3, "terraform_version": "0.11.11", - "serial": 2, + "serial": 7, "lineage": "a27a1d66-bd98-5e4e-cfad-cd96f3f3dabc", "modules": [ { "path": [ "root" ], - "outputs": {}, + "outputs": { + "config_map_aws_auth": { + "sensitive": false, + "type": "string", + "value": "\n\napiVersion: v1\nkind: ConfigMap\nmetadata:\n name: aws-auth\n namespace: kube-system\ndata:\n mapRoles: |\n - rolearn: arn:aws:iam::375964158157:role/sensyne_demo_node\n username: system:node:{{EC2PrivateDNSName}}\n groups:\n - system:bootstrappers\n - system:nodes\n" + }, + "kubeconfig": { + "sensitive": false, + "type": "string", + "value": "\n\napiVersion: v1\nclusters:\n- cluster:\n server: https://6730A6C56BEDCF6C18C9E0985D183A4B.yl4.eu-west-2.eks.amazonaws.com\n certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRFNU1EVXdPVEV6TWpVeE9Gb1hEVEk1TURVd05qRXpNalV4T0Zvd0ZUR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sNGgrNHR4agovUnNwYjl1ZTE1T082bUcxOThIK2JiOU1XYWdId0hkclc3S1A5MCtkVmpzanlUSUlEZk1iMDc3MG9sQT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=\n name: kubernetes\ncontexts:\n- context:\n cluster: kubernetes\n user: aws\n name: aws\ncurrent-context: aws\nkind: Config\npreferences: {}\nusers:\n- name: aws\n user:\n exec:\n apiVersion: client.authentication.k8s.io/v1alpha1\n command: aws-iam-authenticator\n args:\n - \"token\"\n - \"-i\"\n - \"sensyne_demo_cluster\"\n" + } + }, "resources": { + "aws_autoscaling_group.sensyne_demo_asg": { + "type": "aws_autoscaling_group", + "depends_on": [ + "aws_launch_configuration.sensyne_demo_alc", + "aws_subnet.sensyne_demo_subnet.*" + ], + "primary": { + "id": "sensyne_demo_asg", + "attributes": { + "arn": "arn:aws:autoscaling:eu-west-2:375964158157:autoScalingGroup:c7d9a162-5785-40d2-83e0-8c65201829b4:autoScalingGroupName/sensyne_demo_asg", + "availability_zones.#": "3", + "availability_zones.1501760113": "eu-west-2b", + "availability_zones.3230292939": "eu-west-2a", + "availability_zones.780417767": "eu-west-2c", + "default_cooldown": "300", + "desired_capacity": "2", + "enabled_metrics.#": "0", + "force_delete": "false", + "health_check_grace_period": "300", + "health_check_type": "EC2", + "id": "sensyne_demo_asg", + "launch_configuration": "sensyne_demo_alc20190509133810964000000001", + "launch_template.#": "0", + "load_balancers.#": "0", + "max_size": "2", + "metrics_granularity": "1Minute", + "min_size": "1", + "mixed_instances_policy.#": "0", + "name": "sensyne_demo_asg", + "placement_group": "", + "protect_from_scale_in": "false", + "service_linked_role_arn": "arn:aws:iam::375964158157:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling", + "suspended_processes.#": "0", + "tag.#": "2", + "tag.1082171745.key": "Name", + "tag.1082171745.propagate_at_launch": "true", + "tag.1082171745.value": "sensyne_demo_asg_worker", + "tag.352595521.key": "kubernetes.io/cluster/sensyne_demo_cluster", + "tag.352595521.propagate_at_launch": "true", + "tag.352595521.value": "owned", + "target_group_arns.#": "0", + "termination_policies.#": "0", + "vpc_zone_identifier.#": "3", + "vpc_zone_identifier.2341586835": "subnet-092000fedec469965", + "vpc_zone_identifier.2654009030": "subnet-04686c4f0f94f9fa9", + "vpc_zone_identifier.3288980443": "subnet-0b3918beebbd8cb29", + "wait_for_capacity_timeout": "10m" + }, + "meta": { + "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { + "delete": 600000000000 + } + }, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_eks_cluster.sensyne_demo_cluster": { + "type": "aws_eks_cluster", + "depends_on": [ + "aws_iam_role.sensyne_demo_cluster", + "aws_iam_role_policy_attachment.demo_cluster_AmazonEKSClusterPolicy", + "aws_iam_role_policy_attachment.demo_cluster_AmazonEKSServicePolicy", + "aws_security_group.sensyne_demo_cluster", + "aws_subnet.sensyne_demo_subnet.*" + ], + "primary": { + "id": "sensyne_demo_cluster", + "attributes": { + "arn": "arn:aws:eks:eu-west-2:375964158157:cluster/sensyne_demo_cluster", + "certificate_authority.#": "1", + "certificate_authority.0.data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRFNU1EVXdPVEV6TWpVeE9Gb1hEVEk1TURVd05qRXpNalV4T0Zvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBS1pWCldwTWFLdFRkdWpqUFR4blpOOGNrbzNOQUZtdXJLTTRQaXpIdk9qL2Q2aWF5UVVJb01jZUZxSHNVLzFmWFQ5dzgKTkY5ZmFwZzk2eFd3SnlKWWMrUVFZKzVVaEl5OUJrbXg5NUZ4TTNWZlZLUDRVWGxpYkhmN1ZVbktIQ1grS0NjMApQWmVZUHVJSXNscWE0WmJ2clE4bW55T1VFTkJ2dDJ1ajQrWjZYNTBuSjVSeVZuSU84bGhwLytyV2V5L3RPaGszClBCOGtTSTRJSEQzejhSc2lwMWR1bkU4MmNQQWdsMXVZMVJlWmxQZkxKMUFra1RhWS9vRFNZTG91b3FPWWJxblUKOXluQ1JEZ2diSnUzYW1VTUp5K0NkYzlsc0I2Ryt5RXBkOUp3Y2ZyNUVrbU1VZE1CK2tuUTVhWUFma3NOM3FZRQpOU3QvTXZvRzk1aVNJQmFHOTlFQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFDYlFTc213eE40ZjBMNXUvakd4aVU4SGV6QWgKQW5EQUowYzg5UlpncnlFVXhrWmw4RVJyVExUaHg4VzRpbmJPYS9TWDAyYjJsdk1IZGpCbFZSYWJtR1diQ3RGdwpFdXVwVkExL0NEbUM0c2NZbXduWmJpZGE5QmNCbDcvUXhKeEc0cTYrVGZJUmZXVEw0YTVVM0RrTzgwNXVnYXVKCkVEekE4SXc5OGNnbzJrM1BUbEdqSXVpNmxWc0ZOeVhaVGg4K3J0cjNKNVhhcVE1NlhXMVV4MXdkeUh5akJmdXUKNFllUmVjaEFMbmNzbTZjbnE5UTE0WW5KSWZFcStmaU5rTVN5cTFSaEJFVFBQNEkvdTYwMmRNV1BsNGgrNHR4agovUnNwYjl1ZTE1T082bUcxOThIK2JiOU1XYWdId0hkclc3S1A5MCtkVmpzanlUSUlEZk1iMDc3MG9sQT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=", + "created_at": "2019-05-09 13:18:58 +0000 UTC", + "enabled_cluster_log_types.#": "0", + "endpoint": "https://6730A6C56BEDCF6C18C9E0985D183A4B.yl4.eu-west-2.eks.amazonaws.com", + "id": "sensyne_demo_cluster", + "name": "sensyne_demo_cluster", + "platform_version": "eks.1", + "role_arn": "arn:aws:iam::375964158157:role/sensyne_demo_eks_cluster", + "version": "1.12", + "vpc_config.#": "1", + "vpc_config.0.endpoint_private_access": "false", + "vpc_config.0.endpoint_public_access": "true", + "vpc_config.0.security_group_ids.#": "1", + "vpc_config.0.security_group_ids.1476661699": "sg-00421196f71dc6480", + "vpc_config.0.subnet_ids.#": "3", + "vpc_config.0.subnet_ids.176444816": "subnet-092000fedec469965", + "vpc_config.0.subnet_ids.1925973038": "subnet-0b3918beebbd8cb29", + "vpc_config.0.subnet_ids.294670810": "subnet-04686c4f0f94f9fa9", + "vpc_config.0.vpc_id": "vpc-04518d2c0e2421366" + }, + "meta": { + "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { + "create": 900000000000, + "delete": 900000000000, + "update": 3600000000000 + } + }, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_iam_instance_profile.sensyne_demo_node": { + "type": "aws_iam_instance_profile", + "depends_on": [ + "aws_iam_role.sensyne_demo_node" + ], + "primary": { + "id": "sensyne_demo_profile", + "attributes": { + "arn": "arn:aws:iam::375964158157:instance-profile/sensyne_demo_profile", + "create_date": "2019-05-09T13:18:39Z", + "id": "sensyne_demo_profile", + "name": "sensyne_demo_profile", + "path": "/", + "role": "sensyne_demo_node", + "roles.#": "1", + "roles.2235256968": "sensyne_demo_node", + "unique_id": "AIPAVPCJVZDGX7GF3IRAP" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_iam_role.sensyne_demo_cluster": { + "type": "aws_iam_role", + "depends_on": [], + "primary": { + "id": "sensyne_demo_eks_cluster", + "attributes": { + "arn": "arn:aws:iam::375964158157:role/sensyne_demo_eks_cluster", + "assume_role_policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"eks.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}", + "create_date": "2019-05-09T13:18:38Z", + "description": "", + "force_detach_policies": "false", + "id": "sensyne_demo_eks_cluster", + "max_session_duration": "3600", + "name": "sensyne_demo_eks_cluster", + "path": "/", + "tags.%": "0", + "unique_id": "AROAVPCJVZDGSDJKU6SSV" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_iam_role.sensyne_demo_node": { + "type": "aws_iam_role", + "depends_on": [], + "primary": { + "id": "sensyne_demo_node", + "attributes": { + "arn": "arn:aws:iam::375964158157:role/sensyne_demo_node", + "assume_role_policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"ec2.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}", + "create_date": "2019-05-09T13:18:38Z", + "description": "", + "force_detach_policies": "false", + "id": "sensyne_demo_node", + "max_session_duration": "3600", + "name": "sensyne_demo_node", + "path": "/", + "tags.%": "0", + "unique_id": "AROAVPCJVZDG5C5RE7JNZ" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_iam_role_policy_attachment.demo_cluster_AmazonEKSClusterPolicy": { + "type": "aws_iam_role_policy_attachment", + "depends_on": [ + "aws_iam_role.sensyne_demo_cluster" + ], + "primary": { + "id": "sensyne_demo_eks_cluster-20190509131839229900000003", + "attributes": { + "id": "sensyne_demo_eks_cluster-20190509131839229900000003", + "policy_arn": "arn:aws:iam::aws:policy/AmazonEKSClusterPolicy", + "role": "sensyne_demo_eks_cluster" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_iam_role_policy_attachment.demo_cluster_AmazonEKSServicePolicy": { + "type": "aws_iam_role_policy_attachment", + "depends_on": [ + "aws_iam_role.sensyne_demo_cluster" + ], + "primary": { + "id": "sensyne_demo_eks_cluster-20190509131839239800000004", + "attributes": { + "id": "sensyne_demo_eks_cluster-20190509131839239800000004", + "policy_arn": "arn:aws:iam::aws:policy/AmazonEKSServicePolicy", + "role": "sensyne_demo_eks_cluster" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_iam_role_policy_attachment.demo_node_AmazonEC2ContainerRegistryReadOnly": { + "type": "aws_iam_role_policy_attachment", + "depends_on": [ + "aws_iam_role.sensyne_demo_node" + ], + "primary": { + "id": "sensyne_demo_node-20190509131839188000000001", + "attributes": { + "id": "sensyne_demo_node-20190509131839188000000001", + "policy_arn": "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly", + "role": "sensyne_demo_node" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_iam_role_policy_attachment.demo_node_AmazonEKSWorkerNodePolicy": { + "type": "aws_iam_role_policy_attachment", + "depends_on": [ + "aws_iam_role.sensyne_demo_node" + ], + "primary": { + "id": "sensyne_demo_node-20190509131839227300000002", + "attributes": { + "id": "sensyne_demo_node-20190509131839227300000002", + "policy_arn": "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy", + "role": "sensyne_demo_node" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_iam_role_policy_attachment.demo_node_AmazonEKS_CNI_Policy": { + "type": "aws_iam_role_policy_attachment", + "depends_on": [ + "aws_iam_role.sensyne_demo_node" + ], + "primary": { + "id": "sensyne_demo_node-20190509131839240900000005", + "attributes": { + "id": "sensyne_demo_node-20190509131839240900000005", + "policy_arn": "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy", + "role": "sensyne_demo_node" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, "aws_internet_gateway.sensyne_demo_aws_igw": { "type": "aws_internet_gateway", "depends_on": [ @@ -30,6 +307,43 @@ "deposed": [], "provider": "provider.aws" }, + "aws_launch_configuration.sensyne_demo_alc": { + "type": "aws_launch_configuration", + "depends_on": [ + "aws_iam_instance_profile.sensyne_demo_node", + "aws_security_group.sensyne_demo_node", + "data.aws_ami.eks-worker", + "local.demo-node-userdata" + ], + "primary": { + "id": "sensyne_demo_alc20190509133810964000000001", + "attributes": { + "associate_public_ip_address": "true", + "ebs_block_device.#": "0", + "ebs_optimized": "false", + "enable_monitoring": "true", + "ephemeral_block_device.#": "0", + "iam_instance_profile": "sensyne_demo_profile", + "id": "sensyne_demo_alc20190509133810964000000001", + "image_id": "ami-0c7388116d474ee10", + "instance_type": "m4.large", + "key_name": "", + "name": "sensyne_demo_alc20190509133810964000000001", + "name_prefix": "sensyne_demo_alc", + "root_block_device.#": "0", + "security_groups.#": "1", + "security_groups.1175658005": "sg-00d546af67ae50f58", + "spot_price": "", + "user_data_base64": "IyEvYmluL2Jhc2gKc2V0IC1vIHh0cmFjZQovZXRjL2Vrcy9ib290c3RyYXAuc2ggLS1hcGlzZXJ2ZXItZW5kcG9pbnQgJ2h0dHBzOi8vNjczMEE2QzU2QkVEQ0Y2QzE4QzlFMDk4NUQxODNBNEIueWw0LmV1LXdlc3QtMi5la3MuYW1hem9uYXdzLmNvbScgLS1iNjQtY2x1c3Rlci1jYSAnTFMwdExTMUNSVWRKVGlCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2sxSlNVTjVSRU5EUVdKRFowRjNTVUpCWjBsQ1FVUkJUa0puYTNGb2EybEhPWGN3UWtGUmMwWkJSRUZXVFZKTmQwVlJXVVJXVVZGRVJYZHdjbVJYU213S1kyMDFiR1JIVm5wTlFqUllSRlJGTlUxRVZYZFBWRVY2VFdwVmVFOUdiMWhFVkVrMVRVUlZkMDVxUlhwTmFsVjRUMFp2ZDBaVVJWUk5Ra1ZIUVRGVlJRcEJlRTFMWVROV2FWcFlTblZhV0ZKc1kzcERRMEZUU1hkRVVWbEtTMjlhU1doMlkwNUJVVVZDUWxGQlJHZG5SVkJCUkVORFFWRnZRMmRuUlVKQlMxcFdDbGR3VFdGTGRGUmtkV3BxVUZSNGJscE9PR05yYnpOT1FVWnRkWEpMVFRSUWFYcElkazlxTDJRMmFXRjVV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NWFrSm1kWFVLTkZsbFVtVmphRUZNYm1OemJUWmpibkU1VVRFMFdXNUtTV1pGY1N0bWFVNXJUVk41Y1RGU2FFSkZWRkJRTkVrdmRUWXdNbVJOVjFCc05HZ3JOSFI0YWdvdlVuTndZamwxWlRFMVQwODJiVWN4T1RoSUsySmlPVTFYWVdkSWQwaGtjbGMzUzFBNU1DdGtWbXB6YW5sVVNVbEVaazFpTURjM01HOXNRVDBLTFMwdExTMUZUa1FnUTBWU1ZFbEdTVU5CVkVVdExTMHRMUW89JyAnc2Vuc3luZV9kZW1vX2NsdXN0ZXInCg==", + "vpc_classic_link_id": "", + "vpc_classic_link_security_groups.#": "0" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, "aws_route_table.sensyne_demo_route_table": { "type": "aws_route_table", "depends_on": [ @@ -99,6 +413,266 @@ "deposed": [], "provider": "provider.aws" }, + "aws_route_table_association.sensyne_demo_route_table_ass.2": { + "type": "aws_route_table_association", + "depends_on": [ + "aws_route_table.sensyne_demo_route_table", + "aws_subnet.sensyne_demo_subnet.*" + ], + "primary": { + "id": "rtbassoc-0ebacb44e7b5ef454", + "attributes": { + "id": "rtbassoc-0ebacb44e7b5ef454", + "route_table_id": "rtb-0c828921b2d4d85c0", + "subnet_id": "subnet-0b3918beebbd8cb29" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_security_group.sensyne_demo_cluster": { + "type": "aws_security_group", + "depends_on": [ + "aws_vpc.sensyne_demo_vpc" + ], + "primary": { + "id": "sg-00421196f71dc6480", + "attributes": { + "arn": "arn:aws:ec2:eu-west-2:375964158157:security-group/sg-00421196f71dc6480", + "description": "Cluster communication with worker nodes", + "egress.#": "1", + "egress.482069346.cidr_blocks.#": "1", + "egress.482069346.cidr_blocks.0": "0.0.0.0/0", + "egress.482069346.description": "", + "egress.482069346.from_port": "0", + "egress.482069346.ipv6_cidr_blocks.#": "0", + "egress.482069346.prefix_list_ids.#": "0", + "egress.482069346.protocol": "-1", + "egress.482069346.security_groups.#": "0", + "egress.482069346.self": "false", + "egress.482069346.to_port": "0", + "id": "sg-00421196f71dc6480", + "ingress.#": "2", + "ingress.3021715561.cidr_blocks.#": "0", + "ingress.3021715561.description": "Allow pods to communicate with the cluster API Server", + "ingress.3021715561.from_port": "443", + "ingress.3021715561.ipv6_cidr_blocks.#": "0", + "ingress.3021715561.prefix_list_ids.#": "0", + "ingress.3021715561.protocol": "tcp", + "ingress.3021715561.security_groups.#": "1", + "ingress.3021715561.security_groups.1175658005": "sg-00d546af67ae50f58", + "ingress.3021715561.self": "false", + "ingress.3021715561.to_port": "443", + "ingress.3278662766.cidr_blocks.#": "1", + "ingress.3278662766.cidr_blocks.0": "81.187.12.210/32", + "ingress.3278662766.description": "Allow external comms with cluster", + "ingress.3278662766.from_port": "443", + "ingress.3278662766.ipv6_cidr_blocks.#": "0", + "ingress.3278662766.prefix_list_ids.#": "0", + "ingress.3278662766.protocol": "tcp", + "ingress.3278662766.security_groups.#": "0", + "ingress.3278662766.self": "false", + "ingress.3278662766.to_port": "443", + "name": "sensyne-demo-cluster-sg", + "owner_id": "375964158157", + "revoke_rules_on_delete": "false", + "tags.%": "1", + "tags.Name": "sensyne_demo_cluster_sg", + "vpc_id": "vpc-04518d2c0e2421366" + }, + "meta": { + "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { + "create": 600000000000, + "delete": 600000000000 + }, + "schema_version": "1" + }, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_security_group.sensyne_demo_node": { + "type": "aws_security_group", + "depends_on": [ + "aws_vpc.sensyne_demo_vpc" + ], + "primary": { + "id": "sg-00d546af67ae50f58", + "attributes": { + "arn": "arn:aws:ec2:eu-west-2:375964158157:security-group/sg-00d546af67ae50f58", + "description": "Security group for all nodes in the cluster", + "egress.#": "1", + "egress.482069346.cidr_blocks.#": "1", + "egress.482069346.cidr_blocks.0": "0.0.0.0/0", + "egress.482069346.description": "", + "egress.482069346.from_port": "0", + "egress.482069346.ipv6_cidr_blocks.#": "0", + "egress.482069346.prefix_list_ids.#": "0", + "egress.482069346.protocol": "-1", + "egress.482069346.security_groups.#": "0", + "egress.482069346.self": "false", + "egress.482069346.to_port": "0", + "id": "sg-00d546af67ae50f58", + "ingress.#": "2", + "ingress.2278689831.cidr_blocks.#": "0", + "ingress.2278689831.description": "Allow node to communicate with each other", + "ingress.2278689831.from_port": "0", + "ingress.2278689831.ipv6_cidr_blocks.#": "0", + "ingress.2278689831.prefix_list_ids.#": "0", + "ingress.2278689831.protocol": "-1", + "ingress.2278689831.security_groups.#": "0", + "ingress.2278689831.self": "true", + "ingress.2278689831.to_port": "0", + "ingress.3172124372.cidr_blocks.#": "0", + "ingress.3172124372.description": "Allow worker Kubelets and pods to receive communication from the cluster control plane", + "ingress.3172124372.from_port": "1025", + "ingress.3172124372.ipv6_cidr_blocks.#": "0", + "ingress.3172124372.prefix_list_ids.#": "0", + "ingress.3172124372.protocol": "tcp", + "ingress.3172124372.security_groups.#": "1", + "ingress.3172124372.security_groups.1664590368": "sg-00421196f71dc6480", + "ingress.3172124372.self": "false", + "ingress.3172124372.to_port": "65535", + "name": "sensyne_demo_node", + "owner_id": "375964158157", + "revoke_rules_on_delete": "false", + "tags.%": "1", + "tags.Name": "sensyne-demo-worker-node", + "vpc_id": "vpc-04518d2c0e2421366" + }, + "meta": { + "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { + "create": 600000000000, + "delete": 600000000000 + }, + "schema_version": "1" + }, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_security_group_rule.sensyne_demo_cluster_ingress_node_https": { + "type": "aws_security_group_rule", + "depends_on": [ + "aws_security_group.sensyne_demo_cluster", + "aws_security_group.sensyne_demo_node" + ], + "primary": { + "id": "sgrule-2494997055", + "attributes": { + "cidr_blocks.#": "0", + "description": "Allow pods to communicate with the cluster API Server", + "from_port": "443", + "id": "sgrule-2494997055", + "ipv6_cidr_blocks.#": "0", + "prefix_list_ids.#": "0", + "protocol": "tcp", + "security_group_id": "sg-00421196f71dc6480", + "self": "false", + "source_security_group_id": "sg-00d546af67ae50f58", + "to_port": "443", + "type": "ingress" + }, + "meta": { + "schema_version": "2" + }, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_security_group_rule.sensyne_demo_cluster_remote_access": { + "type": "aws_security_group_rule", + "depends_on": [ + "aws_security_group.sensyne_demo_cluster" + ], + "primary": { + "id": "sgrule-3914968742", + "attributes": { + "cidr_blocks.#": "1", + "cidr_blocks.0": "81.187.12.210/32", + "description": "Allow external comms with cluster", + "from_port": "443", + "id": "sgrule-3914968742", + "ipv6_cidr_blocks.#": "0", + "prefix_list_ids.#": "0", + "protocol": "tcp", + "security_group_id": "sg-00421196f71dc6480", + "self": "false", + "to_port": "443", + "type": "ingress" + }, + "meta": { + "schema_version": "2" + }, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_security_group_rule.sensyne_demo_node_ingress_cluster": { + "type": "aws_security_group_rule", + "depends_on": [ + "aws_security_group.sensyne_demo_cluster", + "aws_security_group.sensyne_demo_node" + ], + "primary": { + "id": "sgrule-256439334", + "attributes": { + "cidr_blocks.#": "0", + "description": "Allow worker Kubelets and pods to receive communication from the cluster control plane", + "from_port": "1025", + "id": "sgrule-256439334", + "ipv6_cidr_blocks.#": "0", + "prefix_list_ids.#": "0", + "protocol": "tcp", + "security_group_id": "sg-00d546af67ae50f58", + "self": "false", + "source_security_group_id": "sg-00421196f71dc6480", + "to_port": "65535", + "type": "ingress" + }, + "meta": { + "schema_version": "2" + }, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, + "aws_security_group_rule.sensyne_demo_node_ingress_self": { + "type": "aws_security_group_rule", + "depends_on": [ + "aws_security_group.sensyne_demo_node" + ], + "primary": { + "id": "sgrule-868716314", + "attributes": { + "cidr_blocks.#": "0", + "description": "Allow node to communicate with each other", + "from_port": "0", + "id": "sgrule-868716314", + "ipv6_cidr_blocks.#": "0", + "prefix_list_ids.#": "0", + "protocol": "-1", + "security_group_id": "sg-00d546af67ae50f58", + "self": "false", + "source_security_group_id": "sg-00d546af67ae50f58", + "to_port": "0", + "type": "ingress" + }, + "meta": { + "schema_version": "2" + }, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, "aws_subnet.sensyne_demo_subnet.0": { "type": "aws_subnet", "depends_on": [ @@ -169,6 +743,41 @@ "deposed": [], "provider": "provider.aws" }, + "aws_subnet.sensyne_demo_subnet.2": { + "type": "aws_subnet", + "depends_on": [ + "aws_vpc.sensyne_demo_vpc", + "data.aws_availability_zones.available" + ], + "primary": { + "id": "subnet-0b3918beebbd8cb29", + "attributes": { + "arn": "arn:aws:ec2:eu-west-2:375964158157:subnet/subnet-0b3918beebbd8cb29", + "assign_ipv6_address_on_creation": "false", + "availability_zone": "eu-west-2c", + "availability_zone_id": "euw2-az1", + "cidr_block": "10.0.2.0/24", + "id": "subnet-0b3918beebbd8cb29", + "ipv6_cidr_block": "", + "ipv6_cidr_block_association_id": "", + "map_public_ip_on_launch": "false", + "owner_id": "375964158157", + "tags.%": "1", + "tags.Name": "sensyne_demo_subnet", + "vpc_id": "vpc-04518d2c0e2421366" + }, + "meta": { + "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { + "create": 600000000000, + "delete": 600000000000 + }, + "schema_version": "1" + }, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, "aws_vpc.sensyne_demo_vpc": { "type": "aws_vpc", "depends_on": [], @@ -201,13 +810,68 @@ "deposed": [], "provider": "provider.aws" }, + "data.aws_ami.eks-worker": { + "type": "aws_ami", + "depends_on": [ + "aws_eks_cluster.sensyne_demo_cluster" + ], + "primary": { + "id": "ami-0c7388116d474ee10", + "attributes": { + "architecture": "x86_64", + "block_device_mappings.#": "1", + "block_device_mappings.3798922657.device_name": "/dev/xvda", + "block_device_mappings.3798922657.ebs.%": "6", + "block_device_mappings.3798922657.ebs.delete_on_termination": "true", + "block_device_mappings.3798922657.ebs.encrypted": "false", + "block_device_mappings.3798922657.ebs.iops": "0", + "block_device_mappings.3798922657.ebs.snapshot_id": "snap-0cace1e28d114ad5b", + "block_device_mappings.3798922657.ebs.volume_size": "20", + "block_device_mappings.3798922657.ebs.volume_type": "gp2", + "block_device_mappings.3798922657.no_device": "", + "block_device_mappings.3798922657.virtual_name": "", + "creation_date": "2019-03-30T00:33:04.000Z", + "description": "EKS Kubernetes Worker AMI with AmazonLinux2 image (k8s: 1.12.7/2019-03-27/bin/linux/amd64, docker:18.06)", + "filter.#": "1", + "filter.3458727952.name": "name", + "filter.3458727952.values.#": "1", + "filter.3458727952.values.0": "amazon-eks-node-1.12-v*", + "hypervisor": "xen", + "id": "ami-0c7388116d474ee10", + "image_id": "ami-0c7388116d474ee10", + "image_location": "602401143452/amazon-eks-node-1.12-v20190329", + "image_type": "machine", + "most_recent": "true", + "name": "amazon-eks-node-1.12-v20190329", + "owner_id": "602401143452", + "owners.#": "1", + "owners.0": "602401143452", + "product_codes.#": "0", + "public": "true", + "root_device_name": "/dev/xvda", + "root_device_type": "ebs", + "root_snapshot_id": "snap-0cace1e28d114ad5b", + "sriov_net_support": "simple", + "state": "available", + "state_reason.%": "2", + "state_reason.code": "UNSET", + "state_reason.message": "UNSET", + "tags.%": "0", + "virtualization_type": "hvm" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" + }, "data.aws_availability_zones.available": { "type": "aws_availability_zones", "depends_on": [], "primary": { - "id": "2019-05-09 09:43:34.620858829 +0000 UTC", + "id": "2019-05-09 13:48:30.300835061 +0000 UTC", "attributes": { - "id": "2019-05-09 09:43:34.620858829 +0000 UTC", + "id": "2019-05-09 13:48:30.300835061 +0000 UTC", "names.#": "3", "names.0": "eu-west-2a", "names.1": "eu-west-2b", @@ -222,6 +886,23 @@ }, "deposed": [], "provider": "provider.aws" + }, + "data.aws_region.current": { + "type": "aws_region", + "depends_on": [], + "primary": { + "id": "eu-west-2", + "attributes": { + "description": "EU (London)", + "endpoint": "ec2.eu-west-2.amazonaws.com", + "id": "eu-west-2", + "name": "eu-west-2" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.aws" } }, "depends_on": [] |