CfnAccessGrantProps Struct Added in v2.276.0
Properties for defining a CfnAccessGrant.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';
const cfnAccessGrantProps: cloudwatch.CfnAccessGrantProps = {
domainId: 'domainId',
name: 'name',
permission: 'permission',
principal: {
principalType: 'principalType',
// the properties below are optional
principalAttributes: [{
key: 'key',
value: 'value',
}],
principalId: 'principalId',
},
spaceId: 'spaceId',
// the properties below are optional
scopedActions: [{
actions: ['actions'],
// the properties below are optional
contextConditions: {
contextConditionsKey: ['contextConditions'],
},
resources: [{
resourceType: 'resourceType',
// the properties below are optional
resourceArns: ['resourceArns'],
rowScopeGroups: [[{
field: 'field',
operator: 'operator',
values: ['values'],
}]],
signalTypes: ['signalTypes'],
tags: {
tagsKey: 'tags',
},
}],
}],
tags: [{
key: 'key',
value: 'value',
}],
};
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudwatch as cloudwatch
cfn_access_grant_props = cloudwatch.CfnAccessGrantProps(
domain_id="domainId",
name="name",
permission="permission",
principal=cloudwatch.CfnAccessGrant.AccessGrantPrincipalProperty(
principal_type="principalType",
# the properties below are optional
principal_attributes=[cloudwatch.CfnAccessGrant.AccessGrantPrincipalAttributeProperty(
key="key",
value="value"
)],
principal_id="principalId"
),
space_id="spaceId",
# the properties below are optional
scoped_actions=[cloudwatch.CfnAccessGrant.ScopedActionsProperty(
actions=["actions"],
# the properties below are optional
context_conditions={
"context_conditions_key": ["contextConditions"]
},
resources=[cloudwatch.CfnAccessGrant.ResourceScopeProperty(
resource_type="resourceType",
# the properties below are optional
resource_arns=["resourceArns"],
row_scope_groups=[[cloudwatch.CfnAccessGrant.RowScopeProperty(
field="field",
operator="operator",
values=["values"]
)]],
signal_types=["signalTypes"],
tags={
"tags_key": "tags"
}
)]
)],
tags=[CfnTag(
key="key",
value="value"
)]
)
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.cloudwatch.*;
CfnAccessGrantProps cfnAccessGrantProps = CfnAccessGrantProps.builder()
.domainId("domainId")
.name("name")
.permission("permission")
.principal(AccessGrantPrincipalProperty.builder()
.principalType("principalType")
// the properties below are optional
.principalAttributes(List.of(AccessGrantPrincipalAttributeProperty.builder()
.key("key")
.value("value")
.build()))
.principalId("principalId")
.build())
.spaceId("spaceId")
// the properties below are optional
.scopedActions(List.of(ScopedActionsProperty.builder()
.actions(List.of("actions"))
// the properties below are optional
.contextConditions(Map.of(
"contextConditionsKey", List.of("contextConditions")))
.resources(List.of(ResourceScopeProperty.builder()
.resourceType("resourceType")
// the properties below are optional
.resourceArns(List.of("resourceArns"))
.rowScopeGroups(List.of(List.of(RowScopeProperty.builder()
.field("field")
.operator("operator")
.values(List.of("values"))
.build())))
.signalTypes(List.of("signalTypes"))
.tags(Map.of(
"tagsKey", "tags"))
.build()))
.build()))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.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.CloudWatch;
var cfnAccessGrantProps = new CfnAccessGrantProps {
DomainId = "domainId",
Name = "name",
Permission = "permission",
Principal = new AccessGrantPrincipalProperty {
PrincipalType = "principalType",
// the properties below are optional
PrincipalAttributes = new [] { new AccessGrantPrincipalAttributeProperty {
Key = "key",
Value = "value"
} },
PrincipalId = "principalId"
},
SpaceId = "spaceId",
// the properties below are optional
ScopedActions = new [] { new ScopedActionsProperty {
Actions = new [] { "actions" },
// the properties below are optional
ContextConditions = new Dictionary<string, string[]> {
{ "contextConditionsKey", new [] { "contextConditions" } }
},
Resources = new [] { new ResourceScopeProperty {
ResourceType = "resourceType",
// the properties below are optional
ResourceArns = new [] { "resourceArns" },
RowScopeGroups = new [] { new [] { new RowScopeProperty {
Field = "field",
Operator = "operator",
Values = new [] { "values" }
} } },
SignalTypes = new [] { "signalTypes" },
Tags = new Dictionary<string, string> {
{ "tagsKey", "tags" }
}
} }
} },
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
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"
cfnAccessGrantProps := &CfnAccessGrantProps{
DomainId: jsii.String("domainId"),
Name: jsii.String("name"),
Permission: jsii.String("permission"),
Principal: &AccessGrantPrincipalProperty{
PrincipalType: jsii.String("principalType"),
// the properties below are optional
PrincipalAttributes: []interface{}{
&AccessGrantPrincipalAttributeProperty{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
PrincipalId: jsii.String("principalId"),
},
SpaceId: jsii.String("spaceId"),
// the properties below are optional
ScopedActions: []interface{}{
&ScopedActionsProperty{
Actions: []*string{
jsii.String("actions"),
},
// the properties below are optional
ContextConditions: map[string][]*string{
"contextConditionsKey": []*string{
jsii.String("contextConditions"),
},
},
Resources: []interface{}{
&ResourceScopeProperty{
ResourceType: jsii.String("resourceType"),
// the properties below are optional
ResourceArns: []*string{
jsii.String("resourceArns"),
},
RowScopeGroups: []interface{}{
[]interface{}{
&RowScopeProperty{
Field: jsii.String("field"),
Operator: jsii.String("operator"),
Values: []*string{
jsii.String("values"),
},
},
},
},
SignalTypes: []*string{
jsii.String("signalTypes"),
},
Tags: map[string]*string{
"tagsKey": jsii.String("tags"),
},
},
},
},
},
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
}
Properties
The ID of the domain the grant belongs to.
A name that identifies the access grant.
The permission granted.
principalIResolvable | CfnAccessGrant.AccessGrantPrincipalPropertyprincipaltyping.Union[IResolvable, AccessGrantPrincipalProperty]principalIResolvablePrincipalIResolvablePrincipalinterface{}required#The principal receiving the grant.
Specify PrincipalId, PrincipalAttributes, or both.
scopedActionsoptionalIResolvable | IResolvable | CfnAccessGrant.ScopedActionsProperty[]scoped_actionsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ScopedActionsProperty]]]scopedActionsoptionalIResolvableScopedActionsoptionalIResolvableScopedActionsoptionalinterface{}#Groups of actions allowed by the grant, each with the resource scopes and conditions that limit those actions.
The space this grant applies to.
Domain-scoped grants are returned by ListDomainAccessGrantsForOrganization instead.