Skip to content

Instantly share code, notes, and snippets.

@cappetta
Created June 4, 2019 16:48
Show Gist options
  • Save cappetta/5b22f667f70440fe9dbd7c6db8e521b3 to your computer and use it in GitHub Desktop.
Save cappetta/5b22f667f70440fe9dbd7c6db8e521b3 to your computer and use it in GitHub Desktop.
terraform plan --target=module.staging-infrastructure.module.secdevops.aws_instance.kali[0]> /tmp/plan-kali-only.out
cat /tmp/plan-kali-only.out
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
<= read (data resources)
Terraform will perform the following actions:
# module.staging-infrastructure.module.network.data.aws_availability_zones.available will be read during apply
# (config refers to values not yet known)
<= data "aws_availability_zones" "available" {
+ id = (known after apply)
+ names = (known after apply)
+ zone_ids = (known after apply)
}
# module.staging-infrastructure.module.network.aws_subnet.attacker_subnet will be created
+ resource "aws_subnet" "attacker_subnet" {
+ arn = (known after apply)
+ assign_ipv6_address_on_creation = false
+ availability_zone = (known after apply)
+ availability_zone_id = (known after apply)
+ cidr_block = "10.0.1.0/24"
+ id = (known after apply)
+ ipv6_cidr_block = (known after apply)
+ ipv6_cidr_block_association_id = (known after apply)
+ map_public_ip_on_launch = true
+ owner_id = (known after apply)
+ tags = {
+ "environment" = "stage"
+ "name" = "attacker_subnet"
}
+ vpc_id = (known after apply)
}
# module.staging-infrastructure.module.network.aws_subnet.target_subnet will be created
+ resource "aws_subnet" "target_subnet" {
+ arn = (known after apply)
+ assign_ipv6_address_on_creation = false
+ availability_zone = (known after apply)
+ availability_zone_id = (known after apply)
+ cidr_block = "10.0.2.0/24"
+ id = (known after apply)
+ ipv6_cidr_block = (known after apply)
+ ipv6_cidr_block_association_id = (known after apply)
+ map_public_ip_on_launch = false
+ owner_id = (known after apply)
+ tags = {
+ "environment" = "stage"
+ "name" = "target_subnet"
}
+ vpc_id = (known after apply)
}
# module.staging-infrastructure.module.network.aws_vpc.main will be created
+ resource "aws_vpc" "main" {
+ arn = (known after apply)
+ assign_generated_ipv6_cidr_block = false
+ cidr_block = "10.0.0.0/16"
+ default_network_acl_id = (known after apply)
+ default_route_table_id = (known after apply)
+ default_security_group_id = (known after apply)
+ dhcp_options_id = (known after apply)
+ enable_classiclink = (known after apply)
+ enable_classiclink_dns_support = (known after apply)
+ enable_dns_hostnames = (known after apply)
+ enable_dns_support = true
+ id = (known after apply)
+ instance_tenancy = "default"
+ ipv6_association_id = (known after apply)
+ ipv6_cidr_block = (known after apply)
+ main_route_table_id = (known after apply)
+ owner_id = (known after apply)
+ tags = {
+ "environment" = "stage"
+ "name" = "main"
}
}
# module.staging-infrastructure.module.secdevops.data.aws_ami.kali will be read during apply
# (config refers to values not yet known)
<= data "aws_ami" "kali" {
+ architecture = (known after apply)
+ block_device_mappings = (known after apply)
+ creation_date = (known after apply)
+ description = (known after apply)
+ hypervisor = (known after apply)
+ id = (known after apply)
+ image_id = (known after apply)
+ image_location = (known after apply)
+ image_owner_alias = (known after apply)
+ image_type = (known after apply)
+ kernel_id = (known after apply)
+ most_recent = true
+ name = (known after apply)
+ name_regex = ".*kali-2019.1.*"
+ owner_id = (known after apply)
+ owners = [
+ "588675961644",
]
+ platform = (known after apply)
+ product_codes = (known after apply)
+ public = (known after apply)
+ ramdisk_id = (known after apply)
+ root_device_name = (known after apply)
+ root_device_type = (known after apply)
+ root_snapshot_id = (known after apply)
+ sriov_net_support = (known after apply)
+ state = (known after apply)
+ state_reason = (known after apply)
+ tags = (known after apply)
+ virtualization_type = (known after apply)
}
# module.staging-infrastructure.module.secdevops.aws_instance.kali[0] will be created
+ resource "aws_instance" "kali" {
+ ami = (known after apply)
+ arn = (known after apply)
+ associate_public_ip_address = (known after apply)
+ availability_zone = (known after apply)
+ cpu_core_count = (known after apply)
+ cpu_threads_per_core = (known after apply)
+ get_password_data = false
+ host_id = (known after apply)
+ id = (known after apply)
+ instance_state = (known after apply)
+ instance_type = "t2.micro"
+ ipv6_address_count = (known after apply)
+ ipv6_addresses = (known after apply)
+ key_name = "circleci_build"
+ network_interface_id = (known after apply)
+ password_data = (known after apply)
+ placement_group = (known after apply)
+ primary_network_interface_id = (known after apply)
+ private_dns = (known after apply)
+ private_ip = (known after apply)
+ public_dns = (known after apply)
+ public_ip = (known after apply)
+ security_groups = (known after apply)
+ source_dest_check = true
+ subnet_id = (known after apply)
+ tags = {
+ "Environment" = "stage"
+ "Name" = "CyberRange-kali-linux-0"
+ "Terraform" = "True"
}
+ tenancy = (known after apply)
+ user_data = "5a364ca15bc1b39c1831051db17b10792f74ed97"
+ volume_tags = (known after apply)
+ vpc_security_group_ids = (known after apply)
+ ebs_block_device {
+ delete_on_termination = (known after apply)
+ device_name = (known after apply)
+ encrypted = (known after apply)
+ iops = (known after apply)
+ snapshot_id = (known after apply)
+ volume_id = (known after apply)
+ volume_size = (known after apply)
+ volume_type = (known after apply)
}
+ ephemeral_block_device {
+ device_name = (known after apply)
+ no_device = (known after apply)
+ virtual_name = (known after apply)
}
+ network_interface {
+ delete_on_termination = (known after apply)
+ device_index = (known after apply)
+ network_interface_id = (known after apply)
}
+ root_block_device {
+ delete_on_termination = true
+ iops = (known after apply)
+ volume_id = (known after apply)
+ volume_size = 120
+ volume_type = (known after apply)
}
}
# module.staging-infrastructure.module.secdevops.aws_key_pair.circleci_key will be created
+ resource "aws_key_pair" "circleci_key" {
+ fingerprint = (known after apply)
+ id = (known after apply)
+ key_name = "circleci_build"
+ public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOGnCWq/F0BqJM+gnJTwdRfu66c3zisu3naYxqsUKI/RzvNhnbqwVWMcWMoqFmr4o459/zmvew7c/ble22u+kjB33eJehc77WJWA4EExALokj+S1qf6JL1ZDIRYwBmb7edKLecNbhi62bZKldGoqpkxZM0xQG27w9c75YBnVFBFXV0VBB+kOp3QQTZMV5IiOoQ6G6BwY1tGQN3JXkGHYEIAeLQhynn1fXp9Rz0wu8l+0TfjSNNLEMAHondA87aUJRfJZ7icDAGIZ9MGaNFDMmHD84zuIV9sEsfSAJr/aVREMkabcQ+PyShoLrLdS1zMuBVUGxfI7g+tVKnbVdLSD3j"
}
# module.staging-infrastructure.module.secdevops.aws_security_group.kali will be created
+ resource "aws_security_group" "kali" {
+ arn = (known after apply)
+ description = "penetration testing assets"
+ egress = [
+ {
+ cidr_blocks = [
+ "0.0.0.0/0",
]
+ description = ""
+ from_port = 0
+ ipv6_cidr_blocks = []
+ prefix_list_ids = []
+ protocol = "-1"
+ security_groups = []
+ self = false
+ to_port = 0
},
]
+ id = (known after apply)
+ ingress = [
+ {
+ cidr_blocks = [
+ "10.0.1.0/24",
]
+ description = ""
+ from_port = 0
+ ipv6_cidr_blocks = []
+ prefix_list_ids = []
+ protocol = "-1"
+ security_groups = []
+ self = false
+ to_port = 0
},
+ {
+ cidr_blocks = [
+ "188.214.10.182/32",
]
+ description = ""
+ from_port = 0
+ ipv6_cidr_blocks = []
+ prefix_list_ids = []
+ protocol = "-1"
+ security_groups = []
+ self = false
+ to_port = 0
},
+ {
+ cidr_blocks = [
+ "188.214.10.182/32",
]
+ description = ""
+ from_port = 22
+ ipv6_cidr_blocks = []
+ prefix_list_ids = []
+ protocol = "tcp"
+ security_groups = []
+ self = false
+ to_port = 22
},
+ {
+ cidr_blocks = [
+ "188.214.10.182/32",
]
+ description = ""
+ from_port = 5901
+ ipv6_cidr_blocks = []
+ prefix_list_ids = []
+ protocol = "tcp"
+ security_groups = []
+ self = false
+ to_port = 5901
},
]
+ name = "attackers"
+ owner_id = (known after apply)
+ revoke_rules_on_delete = false
+ tags = {
+ "Environment" = "stage"
+ "Name" = "kali"
+ "Terraform" = "True"
}
+ vpc_id = (known after apply)
}
Plan: 6 to add, 0 to change, 0 to destroy.
------------------------------------------------------------------------
Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment