Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Creates or updates a resource policy. Currently, you can use policies to share snapshots across Amazon Web Services accounts.
Synopsis
- data PutResourcePolicy = PutResourcePolicy' {
- policy :: Text
- resourceArn :: Text
- newPutResourcePolicy :: Text -> Text -> PutResourcePolicy
- putResourcePolicy_policy :: Lens' PutResourcePolicy Text
- putResourcePolicy_resourceArn :: Lens' PutResourcePolicy Text
- data PutResourcePolicyResponse = PutResourcePolicyResponse' {}
- newPutResourcePolicyResponse :: Int -> PutResourcePolicyResponse
- putResourcePolicyResponse_resourcePolicy :: Lens' PutResourcePolicyResponse (Maybe ResourcePolicy)
- putResourcePolicyResponse_httpStatus :: Lens' PutResourcePolicyResponse Int
Creating a Request
data PutResourcePolicy Source #
See: newPutResourcePolicy
smart constructor.
PutResourcePolicy' | |
|
Instances
Create a value of PutResourcePolicy
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
PutResourcePolicy
, putResourcePolicy_policy
- The policy to create or update. For example, the following policy grants
a user authorization to restore a snapshot.
"{\"Version\": \"2012-10-17\", \"Statement\" : [{ \"Sid\": \"AllowUserRestoreFromSnapshot\", \"Principal\":{\"AWS\": [\"739247239426\"]}, \"Action\": [\"redshift-serverless:RestoreFromSnapshot\"] , \"Effect\": \"Allow\" }]}"
PutResourcePolicy
, putResourcePolicy_resourceArn
- The Amazon Resource Name (ARN) of the account to create or update a
resource policy for.
Request Lenses
putResourcePolicy_policy :: Lens' PutResourcePolicy Text Source #
The policy to create or update. For example, the following policy grants a user authorization to restore a snapshot.
"{\"Version\": \"2012-10-17\", \"Statement\" : [{ \"Sid\": \"AllowUserRestoreFromSnapshot\", \"Principal\":{\"AWS\": [\"739247239426\"]}, \"Action\": [\"redshift-serverless:RestoreFromSnapshot\"] , \"Effect\": \"Allow\" }]}"
putResourcePolicy_resourceArn :: Lens' PutResourcePolicy Text Source #
The Amazon Resource Name (ARN) of the account to create or update a resource policy for.
Destructuring the Response
data PutResourcePolicyResponse Source #
See: newPutResourcePolicyResponse
smart constructor.
PutResourcePolicyResponse' | |
|
Instances
newPutResourcePolicyResponse Source #
Create a value of PutResourcePolicyResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:resourcePolicy:PutResourcePolicyResponse'
, putResourcePolicyResponse_resourcePolicy
- The policy that was created or updated.
$sel:httpStatus:PutResourcePolicyResponse'
, putResourcePolicyResponse_httpStatus
- The response's http status code.
Response Lenses
putResourcePolicyResponse_resourcePolicy :: Lens' PutResourcePolicyResponse (Maybe ResourcePolicy) Source #
The policy that was created or updated.
putResourcePolicyResponse_httpStatus :: Lens' PutResourcePolicyResponse Int Source #
The response's http status code.