-
Notifications
You must be signed in to change notification settings - Fork 30
Add proxy support to specific AWS BPs. #53
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
Open
oysterbank
wants to merge
2
commits into
master
Choose a base branch
from
micron_poc_aws_forge_DEV-14551
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,14 +4,14 @@ | |
| Library will automatically import this action. | ||
| """ | ||
| import json | ||
| import boto3 | ||
|
|
||
| from common.methods import set_progress | ||
| from infrastructure.models import Environment | ||
| from orders.models import CustomFieldValue | ||
|
|
||
|
|
||
| def run(job, logger=None, **kwargs): | ||
| service = job.resource_set.first()# Replace resource_set to service_set if you are using this script in CB version pre-8.0 | ||
| service = job.resource_set.first() # Replace resource_set to service_set if you are using this script in CB version pre-8.0 | ||
|
|
||
| # The Environment ID and RDS Instance data dict were stored as attributes on | ||
| # this service by a build action. | ||
|
|
@@ -39,13 +39,15 @@ def connect_to_rds(env): | |
| """ | ||
| Return boto connection to the RDS in the specified environment's region. | ||
| """ | ||
| job.set_progress('Connecting to AWS RDS in region {0}.'.format(env.aws_region)) | ||
| set_progress('Connecting to AWS RDS in region {0}.'.format(env.aws_region)) | ||
| rh = env.resource_handler.cast() | ||
| return boto3.client( | ||
| wrapper = rh.get_api_wrapper() | ||
| return wrapper.get_boto3_client( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here as above. |
||
| 'rds', | ||
| region_name=env.aws_region, | ||
| aws_access_key_id=rh.serviceaccount, | ||
| aws_secret_access_key=rh.servicepasswd) | ||
| rh.serviceaccount, | ||
| rh.servicepasswd, | ||
| env.aws_region | ||
| ) | ||
|
|
||
|
|
||
| def boto_instance_to_dict(boto_instance): | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's generally better to separate out return and a function call, doing both on the same line is too many things happening at once, which means if an exception occurs, then the traceback will point to this line and trying to debug would be harder. So I think this should change to: