ClusterPolicyArgs

data class ClusterPolicyArgs(val clusterArn: Output<String>? = null, val policy: Output<String>? = null) : ConvertibleToJava<ClusterPolicyArgs>

Resource for managing an AWS Managed Streaming for Kafka Cluster Policy.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetCallerIdentityArgs;
import com.pulumi.aws.inputs.GetPartitionArgs;
import com.pulumi.aws.msk.ClusterPolicy;
import com.pulumi.aws.msk.ClusterPolicyArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var currentCallerIdentity = AwsFunctions.getCallerIdentity();
final var currentPartition = AwsFunctions.getPartition();
var example = new ClusterPolicy("example", ClusterPolicyArgs.builder()
.clusterArn(aws_msk_cluster.example().arn())
.policy(serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Sid", "ExampleMskClusterPolicy"),
jsonProperty("Effect", "Allow"),
jsonProperty("Principal", jsonObject(
jsonProperty("AWS", String.format("arn:%s:iam::%s:root", currentPartition.applyValue(getPartitionResult -> getPartitionResult.partition()),currentCallerIdentity.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId())))
)),
jsonProperty("Action", jsonArray(
"kafka:Describe*",
"kafka:Get*",
"kafka:CreateVpcConnection",
"kafka:GetBootstrapBrokers"
)),
jsonProperty("Resource", aws_msk_cluster.example().arn())
)))
)))
.build());
}
}

Import

Using pulumi import, import Managed Streaming for Kafka Cluster Policy using the cluster_arn. For example:

$ pulumi import aws:msk/clusterPolicy:ClusterPolicy example arn:aws:kafka:us-west-2:123456789012:cluster/example/279c0212-d057-4dba-9aa9-1c4e5a25bfc7-3

Constructors

Link copied to clipboard
fun ClusterPolicyArgs(clusterArn: Output<String>? = null, policy: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ClusterPolicyArgs

Properties

Link copied to clipboard
val clusterArn: Output<String>? = null

The Amazon Resource Name (ARN) that uniquely identifies the cluster.

Link copied to clipboard
val policy: Output<String>? = null

Resource policy for cluster.