@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
113 lines • 5.1 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.StandardsControlAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* ## Example Usage
*
* ### Basic usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.securityhub.Account("example", {});
* const cisAwsFoundationsBenchmark = new aws.securityhub.StandardsSubscription("cis_aws_foundations_benchmark", {standardsArn: "arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0"}, {
* dependsOn: [example],
* });
* const cisAwsFoundationsBenchmarkDisableIam1 = new aws.securityhub.StandardsControlAssociation("cis_aws_foundations_benchmark_disable_iam_1", {
* standardsArn: cisAwsFoundationsBenchmark.standardsArn,
* securityControlId: "IAM.1",
* associationStatus: "DISABLED",
* updatedReason: "Not needed",
* });
* ```
*
* ## Disabling security control in all standards
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* import * as std from "@pulumi/std";
*
* export = async () => {
* const example = new aws.securityhub.Account("example", {});
* const iam1 = await aws.securityhub.getStandardsControlAssociations({
* securityControlId: "IAM.1",
* });
* const iam1StandardsControlAssociation: aws.securityhub.StandardsControlAssociation[] = [];
* for (const range of std.toset({
* input: iam1.standardsControlAssociations.map(__item => __item.standardsArn),
* }).result.map((v, k) => ({key: k, value: v}))) {
* iam1StandardsControlAssociation.push(new aws.securityhub.StandardsControlAssociation(`iam_1-${range.key}`, {
* standardsArn: range.key,
* securityControlId: iam1.securityControlId,
* associationStatus: "DISABLED",
* updatedReason: "Not needed",
* }));
* }
* }
* ```
*/
class StandardsControlAssociation extends pulumi.CustomResource {
/**
* Get an existing StandardsControlAssociation 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 StandardsControlAssociation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of StandardsControlAssociation. 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'] === StandardsControlAssociation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["associationStatus"] = state?.associationStatus;
resourceInputs["region"] = state?.region;
resourceInputs["securityControlId"] = state?.securityControlId;
resourceInputs["standardsArn"] = state?.standardsArn;
resourceInputs["updatedReason"] = state?.updatedReason;
}
else {
const args = argsOrState;
if (args?.associationStatus === undefined && !opts.urn) {
throw new Error("Missing required property 'associationStatus'");
}
if (args?.securityControlId === undefined && !opts.urn) {
throw new Error("Missing required property 'securityControlId'");
}
if (args?.standardsArn === undefined && !opts.urn) {
throw new Error("Missing required property 'standardsArn'");
}
resourceInputs["associationStatus"] = args?.associationStatus;
resourceInputs["region"] = args?.region;
resourceInputs["securityControlId"] = args?.securityControlId;
resourceInputs["standardsArn"] = args?.standardsArn;
resourceInputs["updatedReason"] = args?.updatedReason;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(StandardsControlAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.StandardsControlAssociation = StandardsControlAssociation;
/** @internal */
StandardsControlAssociation.__pulumiType = 'aws:securityhub/standardsControlAssociation:StandardsControlAssociation';
//# sourceMappingURL=standardsControlAssociation.js.map