@Generated(value="software.amazon.awssdk:codegen") public final class PutResourcePolicyRequest extends CloudWatchLogsRequest implements ToCopyableBuilder<PutResourcePolicyRequest.Builder,PutResourcePolicyRequest>
Modifier and Type | Class and Description |
---|---|
static interface |
PutResourcePolicyRequest.Builder |
Modifier and Type | Method and Description |
---|---|
static PutResourcePolicyRequest.Builder |
builder() |
boolean |
equals(Object obj) |
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz)
Used to retrieve the value of a field from any class that extends
SdkRequest . |
int |
hashCode() |
String |
policyDocument()
Details of the new policy, including the identity of the principal that is enabled to put logs to this account.
|
String |
policyName()
Name of the new policy.
|
static Class<? extends PutResourcePolicyRequest.Builder> |
serializableBuilderClass() |
PutResourcePolicyRequest.Builder |
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.
|
String |
toString() |
overrideConfiguration
copy
public String policyName()
Name of the new policy. This parameter is required.
public String policyDocument()
Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string.
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn" with the ARN of your CloudWatch Logs resource, such as a log group or log stream.
{ "Version": "2012-10-17" "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action":"logs:PutLogEvents", "Resource": logArn } ] }
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn" with the ARN of your CloudWatch Logs resource, such as a log group or log stream.
{ "Version": "2012-10-17" "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action":"logs:PutLogEvents", "Resource": logArn } ] }
public PutResourcePolicyRequest.Builder toBuilder()
ToCopyableBuilder
toBuilder
in interface ToCopyableBuilder<PutResourcePolicyRequest.Builder,PutResourcePolicyRequest>
toBuilder
in class CloudWatchLogsRequest
public static PutResourcePolicyRequest.Builder builder()
public static Class<? extends PutResourcePolicyRequest.Builder> serializableBuilderClass()
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
SdkRequest
SdkRequest
. The field name
specified should match the member name from the corresponding service-2.json model specified in the
codegen-resources folder for a given service. The class specifies what class to cast the returned value to.
If the returned value is also a modeled class, the SdkRequest.getValueForField(String, Class)
method will
again be available.getValueForField
in class SdkRequest
fieldName
- The name of the member to be retrieved.clazz
- The class to cast the returned object to.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.