Skip to content

Commit 90bbac7

Browse files
author
sivaram-mongodb
committed
feat: Backup Compliance Policy CloudFormation Resource
1 parent b0f63b9 commit 90bbac7

26 files changed

Lines changed: 2145 additions & 0 deletions
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"typeName": "MongoDB::Atlas::BackupCompliancePolicy",
3+
"language": "go",
4+
"runtime": "provided.al2",
5+
"entrypoint": "bootstrap",
6+
"testEntrypoint": "bootstrap",
7+
"settings": {
8+
"import_path": "github.com/mongodb/mongodbatlas-cloudformation-resources/backup-compliance-policy",
9+
"protocolVersion": "2.0.0",
10+
"pluginVersion": "2.0.4"
11+
}
12+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.PHONY: build test clean
2+
tags=logging callback metrics scheduler
3+
cgo=0
4+
goos=linux
5+
goarch=amd64
6+
CFNREP_GIT_SHA?=$(shell git rev-parse HEAD)
7+
ldXflags=-s -w -X github.com/mongodb/mongodbatlas-cloudformation-resources/util.defaultLogLevel=info -X github.com/mongodb/mongodbatlas-cloudformation-resources/version.Version=${CFNREP_GIT_SHA}
8+
ldXflagsD=-X github.com/mongodb/mongodbatlas-cloudformation-resources/util.defaultLogLevel=debug -X github.com/mongodb/mongodbatlas-cloudformation-resources/version.Version=${CFNREP_GIT_SHA}
9+
10+
build:
11+
cfn generate
12+
env GOOS=$(goos) CGO_ENABLED=$(cgo) GOARCH=$(goarch) go build -ldflags="$(ldXflags)" -tags="$(tags)" -o bin/bootstrap cmd/main.go
13+
14+
debug:
15+
cfn generate
16+
env GOOS=$(goos) CGO_ENABLED=$(cgo) GOARCH=$(goarch) go build -ldflags="$(ldXflagsD)" -tags="$(tags)" -o bin/bootstrap cmd/main.go
17+
18+
clean:
19+
rm -rf bin
20+
21+
create-test-resources:
22+
@echo "==> Creating test files for contract testing"
23+
./test/contract-testing/cfn-test-create-inputs.sh
24+
25+
run-contract-testing:
26+
@echo "==> Run contract testing"
27+
make build
28+
sam local start-lambda &
29+
cfn test --function-name TestEntrypoint --verbose
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# MongoDB::Atlas::BackupCompliancePolicy
2+
3+
## Description
4+
5+
Resource for managing [Backup Compliance Policy](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/group/endpoint-cloud-backups/operation/updateCompliancePolicy). Backup Compliance Policy prevents any user, regardless of role, from modifying or deleting specific cluster settings, backups, and backup configurations. When enabled, the Backup Compliance Policy will be applied as the minimum policy for all clusters and backups in the project.
6+
7+
## Requirements
8+
9+
To securely give CloudFormation access to your Atlas credentials, you must
10+
set up an [AWS Profile](/README.md#mongodb-atlas-api-keys-credential-management).
11+
12+
## Attributes and Parameters
13+
14+
See the [resource docs](docs/README.md).
15+
16+
## Cloudformation Examples
17+
18+
See the examples [CFN Template](/examples/backup-compliance-policy/README.md) for example resource.

cfn-resources/backup-compliance-policy/cmd/main.go

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cfn-resources/backup-compliance-policy/cmd/resource/config.go

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)