cloudposse / terraform-aws-ec2-instance

Terraform module for provisioning a general purpose EC2 host
https://cloudposse.com/accelerate
Apache License 2.0
168 stars 221 forks source link

feat(aws_instance): conditional IAM instance profile #182

Closed haidargit closed 10 months ago

haidargit commented 10 months ago

what

This PR enables a conditional _iam_instance_profile_ variable for the ec2 module.

why

This feature request offers users the flexibility to decide whether to associate an IAM instance profile with their instances.

references

Kindly review this PR for module improvements. Thank you

haidargit commented 10 months ago

Hi @kevcube , @nitrocode would you help to review the PR or any other changes that need to be added?

Thank you

nitrocode commented 10 months ago

Did you try setting the instance_profile to an empty string to disable its creation without an additional flag?

haidargit commented 10 months ago

which additional flag do you mean, @nitrocode ? could you help comment or point to the code/PR?

Thanks 🙌

joe-niland commented 10 months ago

@nitrocode instance_profile == "" signifies that the default instance profile and role should be created, whereas #180 is requesting that it be possible to create an instance without a profile + role.

haidargit commented 10 months ago

Thank you, yes that's what I meant for this feature request. @joe-niland , @nitrocode

joe-niland commented 10 months ago

/terratest

joe-niland commented 10 months ago

Hi @haidargit please have a look at the Terratest failures: https://github.com/cloudposse/actions/actions/runs/7605926145/job/20710921759

haidargit commented 10 months ago

okay @joe-niland, i am checking on it

haidargit commented 10 months ago

i have committed the changes for applying the consistent types for the true and false result expressions to these two outputs

output "role" & output "role_arn"

could you help test again @joe-niland ? Thanks!

joe-niland commented 10 months ago

/terratest

joe-niland commented 10 months ago

@haidargit all seems fine. I will just make sure @nitrocode is OK with the PR as well before we proceed.

nitrocode commented 10 months ago

I defer to you folks. Thanks for including me. :)

joe-niland commented 10 months ago

Cheers @nitrocode!

Thanks for your contribution @haidargit !

haidargit commented 10 months ago

your welcome @joe-niland, @joe-niland 👍🏻 👍🏻