-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: remove extra quotes from profile, region, external_id, aws_cli_query params #10
fix: remove extra quotes from profile, region, external_id, aws_cli_query params #10
Conversation
Interesting ... the tests are passing using this module. What region are you using? The error could be that "MY-REGION" is being rejected as regions are (for example) "eu-west-1". Can you give a concrete example? |
I've added a couple of tests that replicate the specific error message you have generated. The issue is that region names are only the short form ( |
Thanks @rquadling for taking a look at this. In my case, I am using This is what I am trying to execute:
Elsewhere, I instantiate the module with a simple module call:
This still throws the original error as described:
Let me know if I can provide any more information or if you would like me to test out any changes. You'll note that |
We run the code on MacOS (host) and in a Linux container (pipeline) and so far no issues with this. We use Adding the single quotes is a way to ensure the right thing is passed as a whole unit, and not using space to inject multiple "things". It is expected.
I'd like to be able to generate this error to know what the appropriate fix is. Enclosing a string in quotes removes the potential of having/needing a space in something that gets called and the command line is broken. Can you add the debug file and load that up? The top 2 lines of my 'bad_region_with_debug' test shows:
This is the debug from AWS. I could go from
Worked fine. I've tried with and without So, the debug log file needs is sort of what I'd need to be able to replicate the error. OOI, what version of awscli you running? I've been running the tests locally on 2.13.13 and now upgrading to 2.15.0. Our pipelines are running 2.14.5. Further oddness:
But using double quotes around a single quoted region (something not part of our code):
So, something odd is happening with the quotes here as the CLI happily handles I wonder if there is another quote being passed from somewhere else. Are you hard-coding the But that produces a different error:
Similar, but not exact. I've not managed to replicate the error message you're getting. And dropping the quotes is not something I would do until I can replicate the issue. As a test, locally, I've created a test using SSO credentials and the following tfvars:
and I get output:
The debug log top 2 lines are:
I can't think of anything else that would be breaking this. |
Thanks for the detailed response, and for including I've looked through the log file. The first two lines indicate that the
However, the script fails for a different reason than the ERROR:
I can verify that
and when I check those debug logs:
then the only apparent difference to me is how the argument list is handling the region string. In the original case, it gets passed to the cli as I think its also possible that the earlier aws command: Both of these issues were resolved by switching to using the |
I think if I add space detection/rejection to the variables that have been quoted, then that's comes under a "good enough" solution I think. It won't alter anyone's current usage. Let me have a small play with that and get the testing in. |
A small ish upgrade. All Terraform variables are now tested to reject inappropriate format/structure. Tests are passing. Using it in our projects. V6.0.0 is for you to try out. |
And purely as a "thing" ... you don't need the |
Hey @rquadling thanks for your work on this. I'm happy to report that the issue was resolved when I upgraded the module to |
You're welcome.
…On Tue, 19 Dec 2023, 20:25 Garrett Blinkhorn, ***@***.***> wrote:
Hey @rquadling <https://github.com/rquadling> thanks for your work on
this. I'm happy to report that the issue was resolved when I upgraded the
module to 6.0.0 so I can carry on with my work as intended. Closing this
PR since it is no longer relevant. Thanks!
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAADEAMLOXMCA5Q3Q3DNKATYKHZ2DAVCNFSM6AAAAABANIGFBKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRTGQZDKMRTGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hey guys, great module and solves some specific pain points we're having around rendering certain data sets from AWS. I believe I've discovered a small bug while trying to use the latest version of the module however (please correct me if I'm wrong).
Context:
I instantiate the module using code like:
but applying the module throws the following error:
You'll note that there are two sets of single-quotes on either side of
MY_REGION
- I believe the way that your script handles this parameter (and likely a few others that are handled similarly) is the root cause. After running aterraform init
to pull the module, if I manually make the changes to the script that this PR is incorporating, then your module runs without an issue and returns the desiredresult
. In other words, theregion
parameter is correctly interpreted by the script after this change.Please review the issue and let me know if there is any additional information that you need. If not, I would appreciate you merging this PR so that we can put the module to use using the region parameter as intended. Thanks :)