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

fix: Fix rpdk configs for new cloudformation cli versions #881

Merged
merged 10 commits into from
Feb 1, 2024

Conversation

maastha
Copy link
Collaborator

@maastha maastha commented Jan 22, 2024

Proposed changes

Jira ticket: CLOUDP-220385

This PR updates import path setting in rpdk config of various resources to support newer versions of cloudformation-cli-go-plugin as per aws-cloudformation/cloudformation-cli#1054 (comment)

EDIT (Agustin): As a followup to this draft pull request, I was able to identifying missing changes in the .rpdk-config files and verified the change by creating a stack after publishing a private resource with the latest config changes. Used the following examples project as reference: https://github.com/aws-cloudformation/cloudformation-cli-go-plugin/tree/master/examples/github-repo
This PR will unblock us from developing with latest cloudformation cli versions, which in turn is also used in our publishing workflow.

Type of change:

  • Bug fix (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)
  • This change requires a documentation update

Manual QA performed:

  • cfn invoke for each of CRUDL/cfn test
  • Updated resource in example
  • Published to AWS private registry
  • Used the template in example to create and update a stack in AWS
  • Deleted stack to ensure resources are deleted
  • Created multiple resources in same stack
  • Validated in Atlas UI
  • Included screenshots

Required Checklist:

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • For CFN Resources: I have released by changes in the private registry and proved by change
    works in Atlas

Further comments


debug:
@echo "==> Building handler binary for debugging"
cfn generate
env GOOS=$(goos) CGO_ENABLED=$(cgo) GOARCH=$(goarch) go build -gcflags="$(DEBUG_FLAGS)" -ldflags="$(LINKER_FLAGS)" -tags="$(tags)" -o bin/handler cmd/main.go
env GOOS=$(goos) CGO_ENABLED=$(cgo) GOARCH=$(goarch) go build -gcflags="$(DEBUG_FLAGS)" -ldflags="$(LINKER_FLAGS)" -tags="$(tags)" -o bin/bootstrap cmd/main.go
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updating to work with latest versions of cloudformation-cli-go-plugin as per aws-cloudformation/cloudformation-cli#1053 (comment)
Currently this is resulting in errors when trying to submit resource to private registry and manually creating a stack [Lambda function handler threw an uncaught exception: fork/exec /var/task/handler: no such file or directory]

Copy link
Member

Choose a reason for hiding this comment

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

I was able to reproduce this error. As a follow-up change I also had to adjust entrypoint and testEntrypoint in .rpdk-config file to bootstrap and this way I was able to submit a resource to the private registry and create a stack successfully.

@AgustinBettati AgustinBettati changed the title fix: fix import path setting in rpdk configs for new cloudformation cli versions fix: Fix rpdk configs for new cloudformation cli versions Feb 1, 2024
@AgustinBettati AgustinBettati marked this pull request as ready for review February 1, 2024 11:41
@AgustinBettati AgustinBettati requested a review from a team as a code owner February 1, 2024 11:41
@@ -9,11 +9,11 @@ ldXflagsD=-s -w -X github.com/mongodb/mongodbatlas-cloudformation-resources/util

Copy link
Member

Choose a reason for hiding this comment

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

not changed in this PR but in case you can do it here, all ldXflagsD (debug) must not have -s -w, an example would be:

ldXflagsD=-X github.com/mongodb/mongodbatlas-cloudformation-resources/util.defaultLogLevel=debug -X github.com/mongodb/mongodbatlas-cloudformation-resources/version.Version=${CFNREP_GIT_SHA}

Copy link
Member

Choose a reason for hiding this comment

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

thanks for suggestion, adjusted.

lantoli
lantoli previously approved these changes Feb 1, 2024
@lantoli
Copy link
Member

lantoli commented Feb 1, 2024

can we add/change some doc with the expected cfn cli versions?

marcosuma
marcosuma previously approved these changes Feb 1, 2024
@AgustinBettati AgustinBettati added this pull request to the merge queue Feb 1, 2024
Merged via the queue into master with commit 11973c5 Feb 1, 2024
26 checks passed
@AgustinBettati AgustinBettati deleted the CLOUDP-220385-cfn-cli-errors branch February 1, 2024 15:40
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.

4 participants