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
6 changes: 3 additions & 3 deletions .github/workflows/e2e-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
- name: Run E2E test
shell: bash
env:
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.CLOUD_DEV_PUBLIC_KEY }}
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.CLOUD_DEV_PRIVATE_KEY }}
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_ORG_ID }}
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.ATLAS_PUBLIC_KEY }}
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.ATLAS_PRIVATE_KEY }}
MONGODB_ATLAS_ORG_ID: ${{ secrets.ATLAS_ORG_ID }}
MONGODB_ATLAS_BASE_URL: https://cloud-dev.mongodb.com/
MONGODB_ATLAS_SECRET_PROFILE: cfn-cloud-dev-github-action
run: |
Expand Down
2 changes: 1 addition & 1 deletion cfn-resources/cloud-backup-restore-jobs/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"entrypoint": "handler",
"testEntrypoint": "handler",
"settings": {
"importpath": "github.com/mongodb/mongodbatlas-cloudformation-resources/cloud-backup-restore-jobs",
"import_path": "github.com/mongodb/mongodbatlas-cloudformation-resources/cloud-backup-restore-jobs",
"protocolVersion": "2.0.0",
"pluginVersion": "2.0.4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"entrypoint": "handler",
"testEntrypoint": "handler",
"settings": {
"importpath": "github.com/mongodb/mongodbatlas-cloudformation-resources/cloud-backup-snapshot-export-bucket",
"import_path": "github.com/mongodb/mongodbatlas-cloudformation-resources/cloud-backup-snapshot-export-bucket",
"protocolVersion": "2.0.0",
"pluginVersion": "2.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion cfn-resources/cluster/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"entrypoint": "handler",
"testEntrypoint": "handler",
"settings": {
"importpath": "github.com/mongodb/mongodbatlas-cloudformation-resources/cluster",
"import_path": "github.com/mongodb/mongodbatlas-cloudformation-resources/cluster",
"protocolVersion": "2.0.0",
"pluginVersion": "2.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion cfn-resources/database-user/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"entrypoint": "handler",
"testEntrypoint": "handler",
"settings": {
"importpath": "github.com/mongodb/mongodbatlas-cloudformation-resources/database-user",
"import_path": "github.com/mongodb/mongodbatlas-cloudformation-resources/database-user",
"protocolVersion": "2.0.0",
"pluginVersion": "2.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion cfn-resources/encryption-at-rest/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"entrypoint": "handler",
"testEntrypoint": "handler",
"settings": {
"importpath": "github.com/mongodb/mongodbatlas-cloudformation-resources/encryption-at-rest",
"import_path": "github.com/mongodb/mongodbatlas-cloudformation-resources/encryption-at-rest",
"protocolVersion": "2.0.0",
"pluginVersion": "2.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion cfn-resources/network-container/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"entrypoint": "handler",
"testEntrypoint": "handler",
"settings": {
"importpath": "github.com/mongodb/mongodbatlas-cloudformation-resources/network-container",
"import_path": "github.com/mongodb/mongodbatlas-cloudformation-resources/network-container",
"protocolVersion": "2.0.0",
"pluginVersion": "2.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion cfn-resources/network-peering/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"entrypoint": "handler",
"testEntrypoint": "handler",
"settings": {
"importpath": "github.com/mongodb/mongodbatlas-cloudformation-resources/network-peering",
"import_path": "github.com/mongodb/mongodbatlas-cloudformation-resources/network-peering",
"protocolVersion": "2.0.0",
"pluginVersion": "2.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion cfn-resources/project-ip-access-list/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"entrypoint": "handler",
"testEntrypoint": "handler",
"settings": {
"importpath": "github.com/mongodb/mongodbatlas-cloudformation-resources/project-ip-access-list",
"import_path": "github.com/mongodb/mongodbatlas-cloudformation-resources/project-ip-access-list",
"protocolVersion": "2.0.0",
"pluginVersion": "2.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion cfn-resources/project/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"entrypoint": "handler",
"testEntrypoint": "handler",
"settings": {
"importpath": "github.com/mongodb/mongodbatlas-cloudformation-resources/project",
"import_path": "github.com/mongodb/mongodbatlas-cloudformation-resources/project",
"protocolVersion": "2.0.0",
"pluginVersion": "2.0.4"
}
Expand Down
4 changes: 2 additions & 2 deletions cfn-resources/project/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ LINKER_FLAGS=-s -w -X github.com/mongodb/mongodbatlas-cloudformation-resources/u
build:
@echo "==> Building handler binary"
cfn generate
env GOOS=$(goos) CGO_ENABLED=$(cgo) GOARCH=$(goarch) go build -ldflags="$(LINKER_FLAGS)" -tags="$(tags)" -o bin/handler cmd/main.go
env GOOS=$(goos) CGO_ENABLED=$(cgo) GOARCH=$(goarch) go build -ldflags="$(LINKER_FLAGS)" -tags="$(tags)" -o bin/bootstrap cmd/main.go

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.



clean:
Expand Down
2 changes: 1 addition & 1 deletion cfn-resources/search-index/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"entrypoint": "handler",
"testEntrypoint": "handler",
"settings": {
"importpath": "github.com/mongodb/mongodbatlas-cloudformation-resources/search-index",
"import_path": "github.com/mongodb/mongodbatlas-cloudformation-resources/search-index",
"protocolVersion": "2.0.0",
"pluginVersion": "2.0.4"
}
Expand Down
Loading