You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cloud9): support setting environment owner (#23878)
Closes#22474
----
### All Submissions:
* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)
### Adding new Construct Runtime Dependencies:
* [x] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies)
### New Features
1. Setting environment owner .
2. The 'owner' now could be an IAMuser or Account root user(It allows AWS to determine who has permissions to manage the environment, either an IAM user or the account root user)
* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?
* [x] Unit test for ownerarn
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@@ -104,3 +104,39 @@ new cloud9.Ec2Environment(this, 'C9Env', {
104
104
imageId: cloud9.ImageId.AMAZON_LINUX_2,
105
105
});
106
106
```
107
+
108
+
## Specifying Owners
109
+
110
+
Every Cloud9 Environment has an **owner**. An owner has full control over the environment, and can invite additional members to the environment for collaboration purposes. For more information, see [Working with shared environments in AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/share-environment.html)).
111
+
112
+
By default, the owner will be the identity that creates the Environment, which is most likely your CloudFormation Execution Role when the Environment is created using CloudFormation. Provider a value for the `owner` property to assign a different owner, either a specific IAM User or the AWS Account Root User.
113
+
114
+
`Owner` is a user that owns a Cloud9 environment . `Owner` has their own access permissions, resources. And we can specify an `Owner`in an Ec2 environment which could be of two types, 1. AccountRoot and 2. Iam User. It allows AWS to determine who has permissions to manage the environment, either an IAM user or the account root user (but using the account root user is not recommended, see [environment sharing best practices](https://docs.aws.amazon.com/cloud9/latest/user-guide/share-environment.html#share-environment-best-practices)).
115
+
116
+
To specify the AWS Account Root User as the environment owner, use `Owner.accountRoot()`
117
+
118
+
```ts
119
+
declareconst vpc:ec2.Vpc;
120
+
newcloud9.Ec2Environment(this, 'C9Env', {
121
+
vpc,
122
+
imageId: cloud9.ImageId.AMAZON_LINUX_2,
123
+
124
+
owner: cloud9.Owner.accountRoot('111111111')
125
+
})
126
+
```
127
+
128
+
To specify a specific IAM User as the environment owner, use `Owner.user()`. The user should have the `AWSCloud9Administrator` managed policy
0 commit comments