k1LoW / awsecrets

AWS credentials loader
MIT License
17 stars 9 forks source link

Using the Service Role Attached to an EC2 Instance #33

Open BFTnaito opened 8 months ago

BFTnaito commented 8 months ago

I apologize for the sudden contact. I reached out because there are some things I'd like to confirm regarding the use of this tool.

According to the instructions in the readme, the procedure involves setting up access keys and secret keys for the IAM role.

I would like to run this tool without using access keys and secret keys by utilizing the service role attached to the EC2 instance. Is this possible?

k1LoW commented 8 months ago

Yes.

https://github.com/k1LoW/awsecrets/blob/ff36296689af3cea756cd0aa04f8c42d16e53a71/lib/awsecrets.rb#L138

https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/InstanceProfileCredentials.html

BFTnaito commented 8 months ago

Thank you for your response. I understand that it is possible to perform with the EC2 service role.

May I ask two additional questions to proceed:

1.Can all code used for testing with awspec be in YAML format as long as it corresponds to AWS resources supported by awspec? 2.Would it be possible to receive references on what to include in .aws/config and .aws/credentials when using roles attached to EC2?

k1LoW commented 8 months ago

1.Can all code used for testing with awspec be in YAML format as long as it corresponds to AWS resources supported by awspec?

This gem is awsecrets, not awspec.

Also, I don't think there is anything to define in YAML format.

2.Would it be possible to receive references on what to include in .aws/config and .aws/credentials when using roles attached to EC2?

Sorry, but we do not support AWS or aws-sdk-ruby implementations.

BFTnaito commented 8 months ago

Thank you for your understanding. I apologize for any confusion caused by my previous answer. I have also noted that the information I provided may not be supported. Thank you for bringing it to my attention.

I consider this matter resolved, and if you have any further questions or new inquiries, please feel free to ask.

Translation provided: Thank you for your understanding. I apologize for any confusion caused by my previous answer. I have also noted that the information I provided may not be supported. Thank you for bringing it to my attention.