Conversation
| @@ -0,0 +1,49 @@ | |||
| package bcdaaws | |||
There was a problem hiding this comment.
Moved this from its own package to under our aws helpers package.
There was a problem hiding this comment.
AWS session is no longer a thing in v2. Instead each service creates a client for itself using AWS config.
bcda/bcdacli/cli_test.go
Outdated
| assert.Contains(buf.String(), "Files failed: 1") | ||
| assert.Contains(buf.String(), "Files skipped: 0") | ||
| } | ||
| // func (s *CLITestSuite) TestImportCCLFDirectory() { |
There was a problem hiding this comment.
Tests related to the commented out cli actions.
| type CclfFileProcessor interface { | ||
| // Load a list of valid CCLF files to be imported | ||
| LoadCclfFiles(path string) (cclfList map[string][]*cclfZipMetadata, skipped int, failed int, err error) | ||
| LoadCclfFiles(ctx context.Context, path string) (cclfList map[string][]*cclfZipMetadata, skipped int, failed int, err error) |
There was a problem hiding this comment.
A good amount of changes are just adding ctx to functions. Ctx is now needed for basically kind of AWS interaction.
| return nil, err | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
This whole section seemed to say if DATABASE_URL is not set, then go grab it from param store. This is just as easily made sure to be set elsewhere in our pipelines so I think its ok to clean this up a bit.
There was a problem hiding this comment.
I am 90% sure insights data is now handled via the js lambda in bcda-ops: https://github.com/CMSgov/bcda-ops/tree/main/terraform/modules/insights_data_sampler_lambda
There was a problem hiding this comment.
last update was 4 years ago, so LGTM to remove!
| } else { | ||
| lambda.Start(attributionImportHandler) | ||
| } | ||
| lambda.Start(attributionImportHandler) |
There was a problem hiding this comment.
Dont need these localstack checks anymore. It now just works (assuming you set your test AWS clients up properly).
There was a problem hiding this comment.
I see the previous comment:
// should only be set in local development to avoid making external calls to a real AWS account. - is there a risk of calling our AWS account inadvertently?
There was a problem hiding this comment.
As long as AWS_ENDPOINT_URL is set when anything is run, then anything that runs any kind of aws service will get redirected to that url (generally http://localstack:4566). Localstack does a lot of magic to mimic AWS services APIs.
bcda/lambda/cclf/main.go
Outdated
| logger.Infof("Reading %s event for file %s", e.EventName, filepath) | ||
| if cclf.CheckIfAttributionCSVFile(e.S3.Object.Key) { | ||
| return handleCSVImport(db, s3AssumeRoleArn, filepath) | ||
| return handleCSVImport(ctx, pool, s3Client, ssmClient, filepath) |
There was a problem hiding this comment.
Removed some of the logic above in order to dep inject them into functions. This allows us more flexibility in testing.
There was a problem hiding this comment.
Moved to bcda/aws package
There was a problem hiding this comment.
This whole file is mostly helpers for AWS but also specifically for only running tests. It seems kind of useful but also feels a bit wrong... Wondering if anyone else has feelings about it. Also if it should maybe get moved under bcda/aws?
| } | ||
| } | ||
|
|
||
| // TODO: once we remove que library and upgrade to pgx5 we can move the below functions into manager |
There was a problem hiding this comment.
Followed this TODO and moved it under manager.
There was a problem hiding this comment.
I wend ahead and removed this (and related files). This was originally part of https://jira.cms.gov/browse/BCDA-9491. It was quick and easy and I was in here already so just went ahead and did it.
laurenkrugen-navapbc
left a comment
There was a problem hiding this comment.
Only other comment is a few other places could initialize ctx in the func call, but other than that, LGTM! Thanks for getting this updated and cleaned up! 🎉
michaeljvaldes
left a comment
There was a problem hiding this comment.
Great job! That's a lot of additional work removing/refactoring outdated packages. I also think this design around interacting with AWS/localstack aligns much more with the intent of localstack.
🎫 Ticket
https://jira.cms.gov/browse/BCDA-9484
🛠 Changes
Migrate all AWS packages to v2. Various refactoring and cleanup.
ℹ️ Context
AWS v1 are out of service as of end of July 2025.
🧪 Validation
Local linting and testing.