Open mike-alvarez opened 1 year ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @mike-alvarez 👋 Thank you for taking the time to raise this! On initial review, I'm not certain that this appears to be a bug with the AWS Provider, since the resource(s) are created as expected, and the error seems to stem from the cloud init script. I noticed that you mentioned upgrading versions of Terraform recently. Was the version of the AWS provider changed at that point in time as well?
I did some further testing.
I believe that you are correct. It is not an issue with the AWS Provider. It is an issue with Active Directory itself.
After adding retry logic in userdata.sh using the IP address of Active Directory instead of the DNS, the code is now working.
On 06/12/2023 3:36 PM CDT Justin Retzolk ***@***.***> wrote:
Hey @mike-alvarez 👋 Thank you for taking the time to raise this! On initial review, I'm not certain that this appears to be a bug with the AWS Provider, since the resource(s) are created as expected, and the error seems to stem from the cloud init script. I noticed that you mentioned upgrading versions of Terraform recently. Was the version of the AWS provider changed at that point in time as well?
--
Reply to this email directly or view it on GitHub:
https://github.com/hashicorp/terraform-provider-aws/issues/31466#issuecomment-1588054741
You are receiving this because you were mentioned.
Message ID: ***@***.***>
Terraform Core Version
1.4.5
AWS Provider Version
4.67.0
Affected Resource(s)
Expected Behavior
set the "gzip" option to true and it caused Active Directory "realm" join to fail.
Actual Behavior
during execution of userdata.sh script it failed on the realm join command
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Template
reference to template
command to join AD
Steps to Reproduce
in template_cloudinit_config set the "gzip" option to true - realm join fails
if set "gzip" option to false - realm join successful
Debug Output
n/a
Panic Output
n/a
Important Factoids
Cloud Provider = AWS Template provider version: v2.2.0
If we manually create the EC2 and manually execute the userdata.sh script. It works as expected.
Recently, we upgraded Terraform from 0.15.x to 1.4.5. This is when the issue started to occur.
The userdata.sh script gets another script from an AWS S3 bucket. It is that 2nd script that issues the "realm" command.
Once the EC2 has been created using the userdata.sh, manually rerunning the "realm" command also fails. It is like something in the environment was modified.
References
No response
Would you like to implement a fix?
None