Class PutResourcePolicyRequest
- java.lang.Object
-
- software.amazon.awssdk.core.SdkRequest
-
- software.amazon.awssdk.awscore.AwsRequest
-
- software.amazon.awssdk.services.cloudwatchlogs.model.CloudWatchLogsRequest
-
- software.amazon.awssdk.services.cloudwatchlogs.model.PutResourcePolicyRequest
-
- All Implemented Interfaces:
SdkPojo,ToCopyableBuilder<PutResourcePolicyRequest.Builder,PutResourcePolicyRequest>
@Generated("software.amazon.awssdk:codegen") public final class PutResourcePolicyRequest extends CloudWatchLogsRequest implements ToCopyableBuilder<PutResourcePolicyRequest.Builder,PutResourcePolicyRequest>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePutResourcePolicyRequest.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PutResourcePolicyRequest.Builderbuilder()booleanequals(Object obj)booleanequalsBySdkFields(Object obj)<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)inthashCode()StringpolicyDocument()Details of the new policy, including the identity of the principal that is enabled to put logs to this account.StringpolicyName()Name of the new policy.Map<String,SdkField<?>>sdkFieldNameToField()List<SdkField<?>>sdkFields()static Class<? extends PutResourcePolicyRequest.Builder>serializableBuilderClass()PutResourcePolicyRequest.BuildertoBuilder()StringtoString()Returns a string representation of this object.-
Methods inherited from class software.amazon.awssdk.awscore.AwsRequest
overrideConfiguration
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
policyName
public final String policyName()
Name of the new policy. This parameter is required.
- Returns:
- Name of the new policy. This parameter is required.
-
policyDocument
public final 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. This parameter is required.
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.CloudWatch Logs also supports aws:SourceArn and aws:SourceAccount condition context keys.
In the example resource policy, you would replace the value of
SourceArnwith the resource making the call from RouteĀ 53 to CloudWatch Logs. You would also replace the value ofSourceAccountwith the Amazon Web Services account ID making that call.{ "Version": "2012-10-17", "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action": "logs:PutLogEvents", "Resource": "logArn", "Condition": { "ArnLike": { "aws:SourceArn": "myRoute53ResourceArn" }, "StringEquals": { "aws:SourceAccount": "myAwsAccountId" } } } ] }- Returns:
- 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. This parameter is required.
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.CloudWatch Logs also supports aws:SourceArn and aws:SourceAccount condition context keys.
In the example resource policy, you would replace the value of
SourceArnwith the resource making the call from RouteĀ 53 to CloudWatch Logs. You would also replace the value ofSourceAccountwith the Amazon Web Services account ID making that call.{ "Version": "2012-10-17", "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action": "logs:PutLogEvents", "Resource": "logArn", "Condition": { "ArnLike": { "aws:SourceArn": "myRoute53ResourceArn" }, "StringEquals": { "aws:SourceAccount": "myAwsAccountId" } } } ] }
-
toBuilder
public PutResourcePolicyRequest.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<PutResourcePolicyRequest.Builder,PutResourcePolicyRequest>- Specified by:
toBuilderin classCloudWatchLogsRequest
-
builder
public static PutResourcePolicyRequest.Builder builder()
-
serializableBuilderClass
public static Class<? extends PutResourcePolicyRequest.Builder> serializableBuilderClass()
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classAwsRequest
-
equals
public final boolean equals(Object obj)
- Overrides:
equalsin classAwsRequest
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
public final String toString()
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
-
getValueForField
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
- Overrides:
getValueForFieldin classSdkRequest
-
sdkFieldNameToField
public final Map<String,SdkField<?>> sdkFieldNameToField()
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-
-