@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
104 lines • 4.12 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClusterPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS Managed Streaming for Kafka Cluster Policy.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getCallerIdentity({});
* const currentGetPartition = aws.getPartition({});
* const example = new aws.msk.ClusterPolicy("example", {
* clusterArn: exampleAwsMskCluster.arn,
* policy: JSON.stringify({
* Version: "2012-10-17",
* Statement: [{
* Sid: "ExampleMskClusterPolicy",
* Effect: "Allow",
* Principal: {
* AWS: Promise.all([currentGetPartition, current]).then(([currentGetPartition, current]) => `arn:${currentGetPartition.partition}:iam::${current.accountId}:root`),
* },
* Action: [
* "kafka:Describe*",
* "kafka:Get*",
* "kafka:CreateVpcConnection",
* "kafka:GetBootstrapBrokers",
* ],
* Resource: exampleAwsMskCluster.arn,
* }],
* }),
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Managed Streaming for Kafka Cluster Policy using the `cluster_arn`. For example:
*
* ```sh
* $ pulumi import aws:msk/clusterPolicy:ClusterPolicy example arn:aws:kafka:us-west-2:123456789012:cluster/example/279c0212-d057-4dba-9aa9-1c4e5a25bfc7-3
* ```
*/
class ClusterPolicy extends pulumi.CustomResource {
/**
* Get an existing ClusterPolicy resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new ClusterPolicy(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ClusterPolicy. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ClusterPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["clusterArn"] = state?.clusterArn;
resourceInputs["currentVersion"] = state?.currentVersion;
resourceInputs["policy"] = state?.policy;
resourceInputs["region"] = state?.region;
}
else {
const args = argsOrState;
if (args?.clusterArn === undefined && !opts.urn) {
throw new Error("Missing required property 'clusterArn'");
}
if (args?.policy === undefined && !opts.urn) {
throw new Error("Missing required property 'policy'");
}
resourceInputs["clusterArn"] = args?.clusterArn;
resourceInputs["policy"] = args?.policy;
resourceInputs["region"] = args?.region;
resourceInputs["currentVersion"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ClusterPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.ClusterPolicy = ClusterPolicy;
/** @internal */
ClusterPolicy.__pulumiType = 'aws:msk/clusterPolicy:ClusterPolicy';
//# sourceMappingURL=clusterPolicy.js.map