@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
185 lines • 6.65 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.Analyzer = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an Access Analyzer Analyzer. More information can be found in the [Access Analyzer User Guide](https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html).
*
* ## Example Usage
*
* ### Account Analyzer
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.accessanalyzer.Analyzer("example", {analyzerName: "example"});
* ```
*
* ### Organization Analyzer
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.organizations.Organization("example", {awsServiceAccessPrincipals: ["access-analyzer.amazonaws.com"]});
* const exampleAnalyzer = new aws.accessanalyzer.Analyzer("example", {
* analyzerName: "example",
* type: "ORGANIZATION",
* }, {
* dependsOn: [example],
* });
* ```
*
* ### Organization Unused Access Analyzer With Analysis Rule
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.accessanalyzer.Analyzer("example", {
* analyzerName: "example",
* type: "ORGANIZATION_UNUSED_ACCESS",
* configuration: {
* unusedAccess: {
* unusedAccessAge: 180,
* analysisRule: {
* exclusions: [
* {
* accountIds: [
* "123456789012",
* "234567890123",
* ],
* },
* {
* resourceTags: [
* {
* key1: "value1",
* },
* {
* key2: "value2",
* },
* ],
* },
* ],
* },
* },
* },
* });
* ```
*
* ### Account Internal Access Analyzer by Resource Types
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.accessanalyzer.Analyzer("test", {
* analyzerName: "example",
* type: "ORGANIZATION_INTERNAL_ACCESS",
* configuration: {
* internalAccess: {
* analysisRule: {
* inclusions: [{
* resourceTypes: [
* "AWS::S3::Bucket",
* "AWS::RDS::DBSnapshot",
* "AWS::DynamoDB::Table",
* ],
* }],
* },
* },
* },
* });
* ```
*
* ### Organization Internal Access Analyzer by Account ID and Resource ARN
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.accessanalyzer.Analyzer("test", {
* analyzerName: "example",
* type: "ORGANIZATION_INTERNAL_ACCESS",
* configuration: {
* internalAccess: {
* analysisRule: {
* inclusions: [{
* accountIds: ["123456789012"],
* resourceArns: ["arn:aws:s3:::my-example-bucket"],
* }],
* },
* },
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Access Analyzer Analyzers using the `analyzer_name`. For example:
*
* ```sh
* $ pulumi import aws:accessanalyzer/analyzer:Analyzer example example
* ```
*/
class Analyzer extends pulumi.CustomResource {
/**
* Get an existing Analyzer 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 Analyzer(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Analyzer. 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'] === Analyzer.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["analyzerName"] = state ? state.analyzerName : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["configuration"] = state ? state.configuration : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.analyzerName === undefined) && !opts.urn) {
throw new Error("Missing required property 'analyzerName'");
}
resourceInputs["analyzerName"] = args ? args.analyzerName : undefined;
resourceInputs["configuration"] = args ? args.configuration : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Analyzer.__pulumiType, name, resourceInputs, opts);
}
}
exports.Analyzer = Analyzer;
/** @internal */
Analyzer.__pulumiType = 'aws:accessanalyzer/analyzer:Analyzer';
//# sourceMappingURL=analyzer.js.map