UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

108 lines 5.29 kB
"use strict"; // *** 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.MacsecKeyAssociation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a MAC Security (MACSec) secret key resource for use with Direct Connect. See [MACsec prerequisites](https://docs.aws.amazon.com/directconnect/latest/UserGuide/direct-connect-mac-sec-getting-started.html#mac-sec-prerequisites) for information about MAC Security (MACsec) prerequisites. * * Creating this resource will also create a resource of type `aws.secretsmanager.Secret` which is managed by Direct Connect. While you can import this resource into your state, because this secret is managed by Direct Connect, you will not be able to make any modifications to it. See [How AWS Direct Connect uses AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/integrating_how-services-use-secrets_directconnect.html) for details. * * > **Note:** All arguments including `ckn` and `cak` will be stored in the raw state as plain-text. * **Note:** The `secretArn` argument can only be used to reference a previously created MACSec key. You cannot associate a Secrets Manager secret created outside of the `aws.directconnect.MacsecKeyAssociation` resource. * * ## Example Usage * * ### Create MACSec key with CKN and CAK * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.directconnect.getConnection({ * name: "tf-dx-connection", * }); * const test = new aws.directconnect.MacsecKeyAssociation("test", { * connectionId: example.then(example => example.id), * ckn: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", * cak: "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789", * }); * ``` * * ### Create MACSec key with existing Secrets Manager secret * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.directconnect.getConnection({ * name: "tf-dx-connection", * }); * const exampleGetSecret = aws.secretsmanager.getSecret({ * name: "directconnect!prod/us-east-1/directconnect/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", * }); * const test = new aws.directconnect.MacsecKeyAssociation("test", { * connectionId: example.then(example => example.id), * secretArn: exampleGetSecret.then(exampleGetSecret => exampleGetSecret.arn), * }); * ``` */ class MacsecKeyAssociation extends pulumi.CustomResource { /** * Get an existing MacsecKeyAssociation 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 MacsecKeyAssociation(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of MacsecKeyAssociation. 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'] === MacsecKeyAssociation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cak"] = state?.cak; resourceInputs["ckn"] = state?.ckn; resourceInputs["connectionId"] = state?.connectionId; resourceInputs["region"] = state?.region; resourceInputs["secretArn"] = state?.secretArn; resourceInputs["startOn"] = state?.startOn; resourceInputs["state"] = state?.state; } else { const args = argsOrState; if (args?.connectionId === undefined && !opts.urn) { throw new Error("Missing required property 'connectionId'"); } resourceInputs["cak"] = args?.cak; resourceInputs["ckn"] = args?.ckn; resourceInputs["connectionId"] = args?.connectionId; resourceInputs["region"] = args?.region; resourceInputs["secretArn"] = args?.secretArn; resourceInputs["startOn"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MacsecKeyAssociation.__pulumiType, name, resourceInputs, opts); } } exports.MacsecKeyAssociation = MacsecKeyAssociation; /** @internal */ MacsecKeyAssociation.__pulumiType = 'aws:directconnect/macsecKeyAssociation:MacsecKeyAssociation'; //# sourceMappingURL=macsecKeyAssociation.js.map