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

AWS - Terraform plan with directory services causes panic / crash with segmentation violation code=0x1 addr=0x18 pc=0x40e2395 #27538

Closed
screwnet opened this issue Jan 18, 2021 · 2 comments

Comments

@screwnet
Copy link

screwnet commented Jan 18, 2021

Terraform Version

Terraform v0.14.4

Terraform Configuration Files

main.tf

terraform {

  required_version = "~> 0.14.3"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.24"
    }
  }
}

provider "aws" {
  region = "us-east-1"
}

data "aws_directory_service_directory" "aws-ad" {
  directory_id = "d-10_char_alphanumeric_id"
}

Debug Output

https://gist.github.com/screwnet/b856bba058839d1d415ec3deb975a1bc

Crash Output

https://gist.github.com/screwnet/c845f79b170f0befa8a02a578edc0fed

Expected Behavior

The code should have executed without crashing during terraform plan operation

Actual Behavior

When:

terraform plan

is executed, the code causes Terraform to crash with panic.

Steps to Reproduce

Copy the terraform code above to a test file and run following commands in the same directory:

terraform init
terraform validate
terraform plan

Additional Context

Any invalid values in the resource properties were inserted as a part of cleaning logs.
The AD directory is shared from a different AWS account (via VPC peering and handshake) and was not created in this account. The executed users had admin privileges on DS, EC2 services in the destination account where the code was run.
All routing, security group and peering is working fine as well as aws cli:

$aws ds describe-directories --directory-ids "d-10_char_alphanumeric_id"

{
    "DirectoryDescriptions": [
        {
            "DirectoryId": "d-10_char_alphanumeric_id",
            "Name": "example.com",
            "ShortName": "EXAMPLE",
            "Size": "Small",
            "Edition": "Standard",
            "Alias": "d-10_char_alphanumeric_id",
            "AccessUrl": "d-10_char_alphanumeric_id.awsapps.com",
            "Stage": "Active",
            "ShareStatus": "Shared",
            "ShareMethod": "HANDSHAKE",
            "LaunchTime": 1606833348.919,
            "StageLastUpdatedDateTime": 1608647353.947,
            "Type": "SharedMicrosoftAD",
            "SsoEnabled": false,
            "DesiredNumberOfDomainControllers": 0,
            "OwnerDirectoryDescription": {
                "DirectoryId": "d-actual_AD_10_char_alphanumeric_id",
                "AccountId": "actual_AD_hosted_AWS_Account_ID",
                "DnsIpAddrs":["192.168.1.1","192.168.2.1"],
                "VpcSettings": {
                    "VpcId": "vpc-actual_AD_hosted_AWS_VPC_IDe",
                    "SubnetIds": [["subnet-sn-id","subnet-sn-id2"],
                    "AvailabilityZones": [
                        "us-east-1a",
                        "us-east-1b"
                    ]
                }
            }
        }
    ]
}

References

@ghost
Copy link

ghost commented Jan 19, 2021

This issue has been automatically migrated to hashicorp/terraform-provider-aws#17168 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-aws#17168.

@ghost
Copy link

ghost commented Feb 19, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 19, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants