Show / Hide Table of Contents

Interface IResourcePolicyProps

Properties to associate a data stream with a policy.

Namespace: Amazon.CDK.AWS.Kinesis
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IResourcePolicyProps
Syntax (vb)
Public Interface IResourcePolicyProps
Remarks

ExampleMetadata: infused

Examples
var stream = new Stream(this, "MyStream");
            var streamConsumer = new StreamConsumer(this, "MyStreamConsumer", new StreamConsumerProps {
                StreamConsumerName = "MyStreamConsumer",
                Stream = stream
            });

            // create a custom policy document
            var policyDocument = new PolicyDocument(new PolicyDocumentProps {
                AssignSids = true,
                Statements = new [] {
                    new PolicyStatement(new PolicyStatementProps {
                        Actions = new [] { "kinesis:GetRecords" },
                        Resources = new [] { stream.StreamArn },
                        Principals = new [] { new AnyPrincipal() }
                    }) }
            });

            // create a stream resource policy manually
            // create a stream resource policy manually
            new ResourcePolicy(this, "ResourcePolicy", new ResourcePolicyProps {
                Stream = stream,
                PolicyDocument = policyDocument
            });

            // create a stream consumer resource policy manually
            // create a stream consumer resource policy manually
            new ResourcePolicy(this, "ResourcePolicy", new ResourcePolicyProps {
                StreamConsumer = streamConsumer,
                PolicyDocument = policyDocument
            });

Synopsis

Properties

PolicyDocument

IAM policy document to apply to a data stream.

Stream

The stream this policy applies to.

StreamConsumer

The stream consumer this policy applies to.

Properties

PolicyDocument

IAM policy document to apply to a data stream.

PolicyDocument? PolicyDocument { get; }
Property Value

PolicyDocument

Remarks

Default: - empty policy document

Stream

The stream this policy applies to.

IStream? Stream { get; }
Property Value

IStream

Remarks

Note: only one of stream and streamConsumer must be set.

Default: - policy is not associated to a stream

StreamConsumer

The stream consumer this policy applies to.

IStreamConsumer? StreamConsumer { get; }
Property Value

IStreamConsumer

Remarks

Note: only one of stream and streamConsumer must be set.

Default: - policy is not associated to a consumer

Back to top Generated by DocFX