Skip to content
v2.278.0

ResourcePolicyProps Struct ​

Properties to define Cloudwatch log group resource policy.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_logs as logs } from 'aws-cdk-lib';

declare const policyStatement: iam.PolicyStatement;
const resourcePolicyProps: logs.ResourcePolicyProps = {
  policyStatements: [policyStatement],
  resourcePolicyName: 'resourcePolicyName',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_iam as iam
from aws_cdk import aws_logs as logs

# policy_statement: iam.PolicyStatement

resource_policy_props = logs.ResourcePolicyProps(
    policy_statements=[policy_statement],
    resource_policy_name="resourcePolicyName"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.logs.*;

PolicyStatement policyStatement;

ResourcePolicyProps resourcePolicyProps = ResourcePolicyProps.builder()
        .policyStatements(List.of(policyStatement))
        .resourcePolicyName("resourcePolicyName")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.Logs;

PolicyStatement policyStatement;

var resourcePolicyProps = new ResourcePolicyProps {
    PolicyStatements = new [] { policyStatement },
    ResourcePolicyName = "resourcePolicyName"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var policyStatement PolicyStatement

resourcePolicyProps := &ResourcePolicyProps{
	PolicyStatements: []PolicyStatement{
		policyStatement,
	},
	ResourcePolicyName: jsii.String("resourcePolicyName"),
}

Properties ​

policyStatementsoptionalPolicyStatement[]policy_statementsoptionaltyping.List[PolicyStatement]policyStatementsoptionalList<PolicyStatement>PolicyStatementsoptionalPolicyStatement[]PolicyStatementsoptional*[]PolicyStatement #
Initial statements to add to the resource policy.

Default: No statements

resourcePolicyNameoptionalstringresource_policy_nameoptionalstrresourcePolicyNameoptionalStringResourcePolicyNameoptionalstringResourcePolicyNameoptional*string #
Name of the log group resource policy.

Default: Uses a unique id based on the construct path