Skip to content

Use UPTEST_CLOUD_CREDENTIALS Github repo secret to enable cross-account resource uptesting - #231

Merged
ulucinar merged 1 commit into
crossplane-contrib:mainfrom
ulucinar:fix-e-15
Dec 7, 2022
Merged

Use UPTEST_CLOUD_CREDENTIALS Github repo secret to enable cross-account resource uptesting#231
ulucinar merged 1 commit into
crossplane-contrib:mainfrom
ulucinar:fix-e-15

Conversation

@ulucinar

@ulucinar ulucinar commented Dec 5, 2022

Copy link
Copy Markdown
Collaborator

Description of your changes

This PR proposes a change that would allow us to utilize a second IAM user for cross-account resource uptesting when the repo is properly configured with a second credentials environment variable.

A second ProviderConfig.aws named peer is provisioned in a different AWS account than the default ProviderConfig's account for cross-account testing.

NOTE: This PR introduces a breaking change in the expected syntax for the Github repo secret UPTEST_CLOUD_CREDENTIALS, and the corresponding env. variable UPTEST_CLOUD_CREDENTIALS when running uptest locally with the associated make targets. It now has the following syntax:

DEFAULT='[default]
aws_access_key_id = REDACTED
aws_secret_access_key = REDACTED'
PEER='[default]
aws_access_key_id = REDACTED
aws_secret_access_key = REDACTED'

So the value of the env. variable is expected to have the DEFAULT key to be used as the default set of credentials, and another optional key named PEER.

I have:

  • Run make reviewable test to ensure this PR is ready for review.
  • Update the vault key for UPTEST_CLOUD_CREDENTIALS
  • Change the syntax of the UPTEST_CLOUD_CREDENTIALS secret Github repo secret and add the second IAM user access credentials with the PEER key.
  • Update the vault key for UPTEST_DATASOURCE
  • Update the UPTEST_DATASOURCE Github repo secret so that it contains the ID of this second account.

How has this code been tested

A second ProviderConfig.aws named peer is now available in the test runtime:

image

Please also see: #235

@ulucinar
ulucinar marked this pull request as draft December 5, 2022 22:58
@ulucinar

ulucinar commented Dec 5, 2022

Copy link
Copy Markdown
Collaborator Author

/test-examples="examples/ec2/vpc.yaml"

…ount resource uptesting

Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>

@turkenh turkenh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ulucinar!

@ulucinar

ulucinar commented Dec 6, 2022

Copy link
Copy Markdown
Collaborator Author

We sync'ed with @ezgidemirel who is on support rotation today and we decided to update the repo secret UPTEST_CLOUD_CREDENTIALS with the breaking new syntax change tomorrow.

@ulucinar ulucinar changed the title Use UPTEST_CLOUD_CREDENTIALS_2 Github repo secret to enable cross-account resource uptesting [DO NOT MERGE] Use UPTEST_CLOUD_CREDENTIALS_2 Github repo secret to enable cross-account resource uptesting Dec 6, 2022
@ulucinar ulucinar changed the title [DO NOT MERGE] Use UPTEST_CLOUD_CREDENTIALS_2 Github repo secret to enable cross-account resource uptesting [DO NOT MERGE] Use UPTEST_CLOUD_CREDENTIALS Github repo secret to enable cross-account resource uptesting Dec 7, 2022
@ulucinar ulucinar changed the title [DO NOT MERGE] Use UPTEST_CLOUD_CREDENTIALS Github repo secret to enable cross-account resource uptesting Use UPTEST_CLOUD_CREDENTIALS Github repo secret to enable cross-account resource uptesting Dec 7, 2022
@ulucinar
ulucinar merged commit eb9f1a0 into crossplane-contrib:main Dec 7, 2022
@ulucinar
ulucinar deleted the fix-e-15 branch December 7, 2022 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants