Skip to content
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

Adding support for passing host system AWS_ prefixed variables into runiac container #51

Merged
merged 1 commit into from
Feb 24, 2022

Conversation

drmmarsunited
Copy link
Contributor

fix(chore): preventing multiple loops over the same array
feature(AWS_ vars): Adding AWS_ env var support into run container

Proposed changes

Allowing AWS environment variables to be passed to runiac run container, as they were previously restricted to only allow prefixed like: TF_VAR_, ARM_, RUNIAC_.

Common environment variables, as presented in the entrypoint.sh in the AWS hello world starter, demonstrate the need to allow well-known vars to make their way into the container for use.

Issues for these changes

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (changes to code, which do not change application behavior)

Checklist

  • I have filled out this PR template
  • I have read the CONTRIBUTING doc
  • I have added automated tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (README.md, CHANGELOG.md, etc. - if appropriate)

Dependencies and Blockers

I will be making another PR to the AWS hello world repo adding support for the often used AWS_PROFILE env var.

Relevant Links

AWS CLI/SDK Support Environment Variables

Further comments

None

fix(chore): preventing multiple loops over the same array
@CLAassistant
Copy link

CLAassistant commented Feb 23, 2022

CLA assistant check
All committers have signed the CLA.

@drmmarsunited
Copy link
Contributor Author

File changes screen kind of tough to read. Code block now looks like this:

for _, env := range cmd2.Env {
			if strings.HasPrefix(env, "TF_VAR_") {
				cmd2.Args = append(cmd2.Args, "-e", env)
			}

			if strings.HasPrefix(env, "ARM_") {
				cmd2.Args = append(cmd2.Args, "-e", env)
			}

			if strings.HasPrefix(env, "RUNIAC_") {
				cmd2.Args = append(cmd2.Args, "-e", env)
			}

			if strings.HasPrefix(env, "AWS_") {
				cmd2.Args = append(cmd2.Args, "-e", env)
			}
		}

@tiny-dancer
Copy link
Contributor

LGTM, note the CLA

@github-actions
Copy link

github-actions bot commented Feb 24, 2022

Unit Test Results

  1 files  15 suites   0s ⏱️
54 tests 54 ✔️ 0 💤 0

Results for commit 06737bc.

♻️ This comment has been updated with latest results.

@drmmarsunited
Copy link
Contributor Author

LGTM, note the CLA

Had to add another email address to my profile. CLA taken care of now.

@tiny-dancer tiny-dancer merged commit 06737bc into Optum:main Feb 24, 2022
@tiny-dancer
Copy link
Contributor

@drmmarsunited are you planning any other pull requests or should I cut a release now?

@drmmarsunited
Copy link
Contributor Author

No others planned right here right now. But I'm sure I'll run into more things as I clear each hurdle 🤣

@tiny-dancer
Copy link
Contributor

@drmmarsunited released as v0.0.12

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.

3 participants