Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo policy overrides #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Demo policy overrides #9

wants to merge 1 commit into from

Conversation

ZIJ
Copy link
Contributor

@ZIJ ZIJ commented Nov 17, 2023

No description provided.

@dggrmike
Copy link

dggrmike commented Nov 17, 2023

Digger run report at 2023-11-17 15:44:54 (UTC)
Plan for diggerhq/demo-policy-overrides#dev_demo_policy_overrides
Terraform will perform the following actions:

  # aws_instance.vm_instance0 will be destroyed
  # (because aws_instance.vm_instance0 is not in configuration)
  - resource "aws_instance" "vm_instance0" {
      - ami                                  = "ami-05c13eab67c5d8861" -> null
      - arn                                  = "arn:aws:ec2:us-east-1:209539466991:instance/i-0c2061661000d4503" -> null
      - associate_public_ip_address          = true -> null
      - availability_zone                    = "us-east-1a" -> null
      - cpu_core_count                       = 1 -> null
      - cpu_threads_per_core                 = 1 -> null
      - disable_api_stop                     = false -> null
      - disable_api_termination              = false -> null
      - ebs_optimized                        = false -> null
      - get_password_data                    = false -> null
      - hibernation                          = false -> null
      - id                                   = "i-0c2061661000d4503" -> null
      - instance_initiated_shutdown_behavior = "stop" -> null
      - instance_state                       = "running" -> null
      - instance_type                        = "t2.micro" -> null
      - ipv6_address_count                   = 0 -> null
      - ipv6_addresses                       = [] -> null
      - monitoring                           = false -> null
      - placement_partition_number           = 0 -> null
      - primary_network_interface_id         = "eni-06e498f4e89a002dd" -> null
      - private_dns                          = "ip-10-0-1-184.ec2.internal" -> null
      - private_ip                           = "10.0.1.184" -> null
      - public_ip                            = "3.95.216.102" -> null
      - secondary_private_ips                = [] -> null
      - security_groups                      = [] -> null
      - source_dest_check                    = true -> null
      - subnet_id                            = "subnet-00a47bc70ceb24e6b" -> null
      - tags                                 = {
          - "Name" = "terraform-instance"
        } -> null
      - tags_all                             = {
          - "Name" = "terraform-instance"
        } -> null
      - tenancy                              = "default" -> null
      - user_data_replace_on_change          = false -> null
      - vpc_security_group_ids               = [
          - "sg-019932ea36f0f50d5",
        ] -> null

      - capacity_reservation_specification {
          - capacity_reservation_preference = "open" -> null
        }

      - cpu_options {
          - core_count       = 1 -> null
          - threads_per_core = 1 -> null
        }

      - credit_specification {
          - cpu_credits = "standard" -> null
        }

      - enclave_options {
          - enabled = false -> null
        }

      - maintenance_options {
          - auto_recovery = "default" -> null
        }

      - metadata_options {
          - http_endpoint               = "enabled" -> null
          - http_protocol_ipv6          = "disabled" -> null
          - http_put_response_hop_limit = 2 -> null
          - http_tokens                 = "required" -> null
          - instance_metadata_tags      = "disabled" -> null
        }

      - private_dns_name_options {
          - enable_resource_name_dns_a_record    = false -> null
          - enable_resource_name_dns_aaaa_record = false -> null
          - hostname_type                        = "ip-name" -> null
        }

      - root_block_device {
          - delete_on_termination = true -> null
          - device_name           = "/dev/xvda" -> null
          - encrypted             = false -> null
          - iops                  = 3000 -> null
          - tags                  = {} -> null
          - throughput            = 125 -> null
          - volume_id             = "vol-0d960859272ecdecb" -> null
          - volume_size           = 8 -> null
          - volume_type           = "gp3" -> null
        }
    }

  # aws_instance.vm_instanceTEST will be created
  + resource "aws_instance" "vm_instanceTEST" {
      + ami                                  = "ami-05c13eab67c5d8861"
      + 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)
      + disable_api_stop                     = (known after apply)
      + disable_api_termination              = (known after apply)
      + ebs_optimized                        = (known after apply)
      + get_password_data                    = false
      + host_id                              = (known after apply)
      + host_resource_group_arn              = (known after apply)
      + iam_instance_profile                 = (known after apply)
      + id                                   = (known after apply)
      + instance_initiated_shutdown_behavior = (known after apply)
      + instance_lifecycle                   = (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                             = (known after apply)
      + monitoring                           = (known after apply)
      + outpost_arn                          = (known after apply)
      + password_data                        = (known after apply)
      + placement_group                      = (known after apply)
      + placement_partition_number           = (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)
      + secondary_private_ips                = (known after apply)
      + security_groups                      = [
          + "sg-019932ea36f0f50d5",
        ]
      + source_dest_check                    = true
      + spot_instance_request_id             = (known after apply)
      + subnet_id                            = "subnet-00a47bc70ceb24e6b"
      + tags                                 = {
          + "Name" = "terraform-instance"
        }
      + tags_all                             = {
          + "Name" = "terraform-instance"
        }
      + tenancy                              = (known after apply)
      + user_data                            = (known after apply)
      + user_data_base64                     = (known after apply)
      + user_data_replace_on_change          = false
      + vpc_security_group_ids               = (known after apply)
    }

Plan: 1 to add, 0 to change, 1 to destroy.

─────────────────────────────────────────────────────────────────────────────
Terraform plan validation check (dev_demo_policy_overrides) Terraform plan failed validation checks ❌
Nothing is allowed%!(EXTRA string=aws_instance.vm_instance0)
Nothing is allowed%!(EXTRA string=aws_instance.vm_instanceTEST)
Nothing is allowed%!(EXTRA string=aws_security_group.security_group)
Nothing is allowed%!(EXTRA string=aws_subnet.vpc_subnet)
Nothing is allowed%!(EXTRA string=aws_vpc.vpc_network)

@motatoes motatoes self-requested a review November 17, 2023 15:48
@ZIJ
Copy link
Contributor Author

ZIJ commented Nov 17, 2023

digger apply

@dggrmike
Copy link

Digger run report at 2023-11-17 15:50:44 (UTC)
Policy violation for dev_demo_policy_overrides - digger apply User ZIJ is not allowed to perform action: digger apply. Check your policies ❌

@ZIJ
Copy link
Contributor Author

ZIJ commented Nov 17, 2023

digger apply

@dggrmike
Copy link

Digger run report at 2023-11-17 15:53:29 (UTC)
Apply for diggerhq/demo-policy-overrides#dev_demo_policy_overrides
Terraform will perform the following actions:

  # aws_instance.vm_instance0 will be destroyed
  # (because aws_instance.vm_instance0 is not in configuration)
  - resource "aws_instance" "vm_instance0" {
      - ami                                  = "ami-05c13eab67c5d8861" -> null
      - arn                                  = "arn:aws:ec2:us-east-1:209539466991:instance/i-0c2061661000d4503" -> null
      - associate_public_ip_address          = true -> null
      - availability_zone                    = "us-east-1a" -> null
      - cpu_core_count                       = 1 -> null
      - cpu_threads_per_core                 = 1 -> null
      - disable_api_stop                     = false -> null
      - disable_api_termination              = false -> null
      - ebs_optimized                        = false -> null
      - get_password_data                    = false -> null
      - hibernation                          = false -> null
      - id                                   = "i-0c2061661000d4503" -> null
      - instance_initiated_shutdown_behavior = "stop" -> null
      - instance_state                       = "running" -> null
      - instance_type                        = "t2.micro" -> null
      - ipv6_address_count                   = 0 -> null
      - ipv6_addresses                       = [] -> null
      - monitoring                           = false -> null
      - placement_partition_number           = 0 -> null
      - primary_network_interface_id         = "eni-06e498f4e89a002dd" -> null
      - private_dns                          = "ip-10-0-1-184.ec2.internal" -> null
      - private_ip                           = "10.0.1.184" -> null
      - public_ip                            = "3.95.216.102" -> null
      - secondary_private_ips                = [] -> null
      - security_groups                      = [] -> null
      - source_dest_check                    = true -> null
      - subnet_id                            = "subnet-00a47bc70ceb24e6b" -> null
      - tags                                 = {
          - "Name" = "terraform-instance"
        } -> null
      - tags_all                             = {
          - "Name" = "terraform-instance"
        } -> null
      - tenancy                              = "default" -> null
      - user_data_replace_on_change          = false -> null
      - vpc_security_group_ids               = [
          - "sg-019932ea36f0f50d5",
        ] -> null

      - capacity_reservation_specification {
          - capacity_reservation_preference = "open" -> null
        }

      - cpu_options {
          - core_count       = 1 -> null
          - threads_per_core = 1 -> null
        }

      - credit_specification {
          - cpu_credits = "standard" -> null
        }

      - enclave_options {
          - enabled = false -> null
        }

      - maintenance_options {
          - auto_recovery = "default" -> null
        }

      - metadata_options {
          - http_endpoint               = "enabled" -> null
          - http_protocol_ipv6          = "disabled" -> null
          - http_put_response_hop_limit = 2 -> null
          - http_tokens                 = "required" -> null
          - instance_metadata_tags      = "disabled" -> null
        }

      - private_dns_name_options {
          - enable_resource_name_dns_a_record    = false -> null
          - enable_resource_name_dns_aaaa_record = false -> null
          - hostname_type                        = "ip-name" -> null
        }

      - root_block_device {
          - delete_on_termination = true -> null
          - device_name           = "/dev/xvda" -> null
          - encrypted             = false -> null
          - iops                  = 3000 -> null
          - tags                  = {} -> null
          - throughput            = 125 -> null
          - volume_id             = "vol-0d960859272ecdecb" -> null
          - volume_size           = 8 -> null
          - volume_type           = "gp3" -> null
        }
    }

  # aws_instance.vm_instanceTEST will be created
  + resource "aws_instance" "vm_instanceTEST" {
      + ami                                  = "ami-05c13eab67c5d8861"
      + 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)
      + disable_api_stop                     = (known after apply)
      + disable_api_termination              = (known after apply)
      + ebs_optimized                        = (known after apply)
      + get_password_data                    = false
      + host_id                              = (known after apply)
      + host_resource_group_arn              = (known after apply)
      + iam_instance_profile                 = (known after apply)
      + id                                   = (known after apply)
      + instance_initiated_shutdown_behavior = (known after apply)
      + instance_lifecycle                   = (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                             = (known after apply)
      + monitoring                           = (known after apply)
      + outpost_arn                          = (known after apply)
      + password_data                        = (known after apply)
      + placement_group                      = (known after apply)
      + placement_partition_number           = (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)
      + secondary_private_ips                = (known after apply)
      + security_groups                      = [
          + "sg-019932ea36f0f50d5",
        ]
      + source_dest_check                    = true
      + spot_instance_request_id             = (known after apply)
      + subnet_id                            = "subnet-00a47bc70ceb24e6b"
      + tags                                 = {
          + "Name" = "terraform-instance"
        }
      + tags_all                             = {
          + "Name" = "terraform-instance"
        }
      + tenancy                              = (known after apply)
      + user_data                            = (known after apply)
      + user_data_base64                     = (known after apply)
      + user_data_replace_on_change          = false
      + vpc_security_group_ids               = (known after apply)
    }

Plan: 1 to add, 0 to change, 1 to destroy.
aws_instance.vm_instance0: Destroying... [id=i-0c2061661000d4503]
aws_instance.vm_instanceTEST: Creating...
aws_instance.vm_instance0: Still destroying... [id=i-0c2061661000d4503, 10s elapsed]
aws_instance.vm_instanceTEST: Still creating... [10s elapsed]
aws_instance.vm_instance0: Still destroying... [id=i-0c2061661000d4503, 20s elapsed]
aws_instance.vm_instanceTEST: Still creating... [20s elapsed]
aws_instance.vm_instance0: Still destroying... [id=i-0c2061661000d4503, 30s elapsed]
aws_instance.vm_instanceTEST: Still creating... [30s elapsed]
aws_instance.vm_instance0: Destruction complete after 30s
aws_instance.vm_instanceTEST: Still creating... [40s elapsed]
aws_instance.vm_instanceTEST: Still creating... [50s elapsed]
aws_instance.vm_instanceTEST: Creation complete after 53s [id=i-0953a9021e861ef9e]

Apply complete! Resources: 1 added, 0 changed, 1 destroyed.

@ZIJ ZIJ changed the title Update main.tf Demo policy overrides Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants