|
| 1 | +# resource-policy |
| 2 | + |
| 3 | +The official [MongoDB Atlas](https://www.mongodb.com/) AWS CDK resource for Node.js. |
| 4 | + |
| 5 | +> **NOTE**: |
| 6 | +> - **Atlas Resource Policies functionality is currently in Preview, you'll need to enable `Atlas Resource Policies` Beta Feature in your organization to use it.** |
| 7 | +
|
| 8 | +> AWS CDK [L1 construct] and data structures for the [AWS CloudFormation Registry] type `MongoDB::Atlas::ResourcePolicy`. |
| 9 | +[L1 construct]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html |
| 10 | +[AWS CloudFormation Registry]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html |
| 11 | + |
| 12 | +## Description |
| 13 | + |
| 14 | +Returns, adds, edits, and removes Atlas resource policies. |
| 15 | + |
| 16 | +## MongoDB Atlas API Docs |
| 17 | + |
| 18 | +For more information about the API refer to: [API Endpoints](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Resource-Policies) |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +> [Using Atlas Resource Policy with Cloudformation](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/examples/resource-policy/resource-policy.json) |
| 23 | +
|
| 24 | +In order to use this library, you will need to activate this AWS CloudFormation Registry type in your account. You can do this via the AWS Management Console or using the [AWS CLI](https://aws.amazon.com/cli/) using the following command: |
| 25 | + |
| 26 | +```sh |
| 27 | +aws cloudformation activate-type \ |
| 28 | + --type-name MongoDB::Atlas::ResourcePolicy \ |
| 29 | + --publisher-id bb989456c78c398a858fef18f2ca1bfc1fbba082 \ |
| 30 | + --type RESOURCE \ |
| 31 | + --execution-role-arn ROLE-ARN |
| 32 | +``` |
| 33 | + |
| 34 | +Alternatively: |
| 35 | + |
| 36 | +```sh |
| 37 | +aws cloudformation activate-type \ |
| 38 | + --public-type-arn arn:aws:cloudformation:us-east-1::type/resource/bb989456c78c398a858fef18f2ca1bfc1fbba082/MongoDB-Atlas-ResourcePolicy \ |
| 39 | + --execution-role-arn ROLE-ARN |
| 40 | +``` |
| 41 | + |
| 42 | +You can find more information about activating this type in the [AWS CloudFormation documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-public.html). |
| 43 | + |
| 44 | +## Example: [resource-policy.ts](../../../examples/l1-resources/resource-policy.ts) |
| 45 | +```ts |
| 46 | +import { CfnResourcePolicy } from 'awscdk-resources-mongodbatlas'; |
| 47 | + |
| 48 | + const resourcePolicy = new CfnResourcePolicy(this, "resource-policy-testing-stack", { |
| 49 | + profile: atlasProps.profile, |
| 50 | + name: atlasProps.name, |
| 51 | + orgId: atlasProps.orgId, |
| 52 | + policies: [ |
| 53 | + { |
| 54 | + body: atlasProps.body, |
| 55 | + }, |
| 56 | + ], |
| 57 | + }); |
| 58 | +``` |
| 59 | + |
| 60 | +## Feedback |
| 61 | + |
| 62 | +This library is auto-generated and published to all supported programming languages by the [cdklabs/cdk-cloudformation] project based on the API schema published for `MongoDB::Atlas::ResourcePolicy`. |
| 63 | + |
| 64 | +* Issues related to this generated library should be [reported here](https://github.com/cdklabs/cdk-cloudformation/issues/new?title=Issue+with+%40cdk-cloudformation%2Fmongodb-atlas-resource-policy+v1.0.0). |
| 65 | +* Issues related to `MongoDB::Atlas::ResourcePolicy` should be reported to the [publisher](https://github.com/mongodb/mongodbatlas-cloudformation-resources/issues). |
| 66 | +* Feature requests should be [reported here](https://feedback.mongodb.com/forums/924145-atlas?category_id=392596) |
| 67 | + |
| 68 | +[cdklabs/cdk-cloudformation]: https://github.com/cdklabs/cdk-cloudformation |
| 69 | + |
| 70 | +## License |
| 71 | + |
| 72 | +Distributed under the Apache-2.0 License. |
0 commit comments