import * as pulumi from "@pulumi/pulumi"; /** * Manages a MAC Security (MACSec) secret key association 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:** The `ckn` and `cak` arguments are stored in the raw state as plain-text. Use `cknWo` and `cakWo` instead to avoid storing these values in the plan or state. When `cknWo` is configured, the API-returned CKN is not stored in `ckn`. * * > **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 * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.directconnect.getConnection({ * name: "tf-dx-connection", * }); * const exampleMacsecKeyAssociation = new aws.directconnect.MacsecKeyAssociation("example", { * connectionId: example.then(example => example.id), * ckn: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", * cak: "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789", * }); * ``` * * ### Create MACSec key with write-only 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 config = new pulumi.Config(); * const cak = config.require("cak"); * const ckn = config.require("ckn"); * const exampleMacsecKeyAssociation = new aws.directconnect.MacsecKeyAssociation("example", { * connectionId: example.then(example => example.id), * cakWo: cak, * cakWoVersion: 1, * cknWo: ckn, * cknWoVersion: 1, * }); * ``` * * Changing a write-only value alone does not trigger a change. Increment its corresponding `cakWoVersion` or `cknWoVersion` to replace the association with the new key material. The version counters are independent; increment both when changing both values. * * ### 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 exampleMacsecKeyAssociation = new aws.directconnect.MacsecKeyAssociation("example", { * connectionId: example.then(example => example.id), * secretArn: exampleGetSecret.then(exampleGetSecret => exampleGetSecret.arn), * }); * ``` */ export declare 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: string, id: pulumi.Input, state?: MacsecKeyAssociationState, opts?: pulumi.CustomResourceOptions): MacsecKeyAssociation; /** * Check whether an existing MacsecKeyAssociation resource with the given ID exists. * * @param id The _unique_ provider ID of the resource to check. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static exists(id: pulumi.Input, state?: MacsecKeyAssociationState, opts?: pulumi.CustomResourceOptions): pulumi.Output; /** * 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: any): obj is MacsecKeyAssociation; /** * MAC Security (MACsec) CAK to associate with the dedicated connection. Valid values are 64 hexadecimal characters (0-9, A-F). Required with `ckn` or `cknWo` unless `cakWo` is configured. Conflicts with `cakWo`. Changing this argument replaces the association. */ readonly cak: pulumi.Output; /** * **NOTE:** This field is write-only and its value will not be updated in state as part of read operations. * Write-only MAC Security (MACsec) CAK to associate with the dedicated connection. Valid values are 64 hexadecimal characters (0-9, A-F). Requires `cakWoVersion` and either `ckn` or `cknWo`. Conflicts with `cak` and `secretArn`. This value is not stored in the plan or state. */ readonly cakWo: pulumi.Output; /** * Positive integer used to trigger replacement when `cakWo` changes. Required with `cakWo`. Increment this value to replace the association using the current write-only values. */ readonly cakWoVersion: pulumi.Output; /** * MAC Security (MACsec) CKN to associate with the dedicated connection. Valid values are 64 hexadecimal characters (0-9, A-F). Required with `cak` or `cakWo` unless `cknWo` is configured. Conflicts with `cknWo`. Changing this argument replaces the association. */ readonly ckn: pulumi.Output; /** * **NOTE:** This field is write-only and its value will not be updated in state as part of read operations. * Write-only MAC Security (MACsec) CKN to associate with the dedicated connection. Valid values are 64 hexadecimal characters (0-9, A-F). Requires `cknWoVersion` and either `cak` or `cakWo`. Conflicts with `ckn` and `secretArn`. This value is not stored in the plan or state. */ readonly cknWo: pulumi.Output; /** * Positive integer used to trigger replacement when `cknWo` changes. Required with `cknWo`. Increment this value to replace the association using the current write-only values. */ readonly cknWoVersion: pulumi.Output; /** * ID of the dedicated Direct Connect connection. The connection must be a dedicated connection in the `AVAILABLE` state. * * The following arguments are optional: */ readonly connectionId: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; /** * ARN of the MAC Security (MACsec) secret key to associate with the dedicated connection. * * > **Note:** Supply either a CAK/CKN pair (using regular or write-only arguments) or `secretArn`. Do not combine key arguments with `secretArn`. */ readonly secretArn: pulumi.Output; /** * The date in UTC format that the MAC Security (MACsec) secret key takes effect. */ readonly startOn: pulumi.Output; /** * The state of the MAC Security (MACsec) secret key. The possible values are: associating, associated, disassociating, disassociated. See [MacSecKey](https://docs.aws.amazon.com/directconnect/latest/APIReference/API_MacSecKey.html#DX-Type-MacSecKey-state) for descriptions of each state. */ readonly state: pulumi.Output; /** * Create a MacsecKeyAssociation resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: MacsecKeyAssociationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering MacsecKeyAssociation resources. */ export interface MacsecKeyAssociationState { /** * MAC Security (MACsec) CAK to associate with the dedicated connection. Valid values are 64 hexadecimal characters (0-9, A-F). Required with `ckn` or `cknWo` unless `cakWo` is configured. Conflicts with `cakWo`. Changing this argument replaces the association. */ cak?: pulumi.Input; /** * **NOTE:** This field is write-only and its value will not be updated in state as part of read operations. * Write-only MAC Security (MACsec) CAK to associate with the dedicated connection. Valid values are 64 hexadecimal characters (0-9, A-F). Requires `cakWoVersion` and either `ckn` or `cknWo`. Conflicts with `cak` and `secretArn`. This value is not stored in the plan or state. */ cakWo?: pulumi.Input; /** * Positive integer used to trigger replacement when `cakWo` changes. Required with `cakWo`. Increment this value to replace the association using the current write-only values. */ cakWoVersion?: pulumi.Input; /** * MAC Security (MACsec) CKN to associate with the dedicated connection. Valid values are 64 hexadecimal characters (0-9, A-F). Required with `cak` or `cakWo` unless `cknWo` is configured. Conflicts with `cknWo`. Changing this argument replaces the association. */ ckn?: pulumi.Input; /** * **NOTE:** This field is write-only and its value will not be updated in state as part of read operations. * Write-only MAC Security (MACsec) CKN to associate with the dedicated connection. Valid values are 64 hexadecimal characters (0-9, A-F). Requires `cknWoVersion` and either `cak` or `cakWo`. Conflicts with `ckn` and `secretArn`. This value is not stored in the plan or state. */ cknWo?: pulumi.Input; /** * Positive integer used to trigger replacement when `cknWo` changes. Required with `cknWo`. Increment this value to replace the association using the current write-only values. */ cknWoVersion?: pulumi.Input; /** * ID of the dedicated Direct Connect connection. The connection must be a dedicated connection in the `AVAILABLE` state. * * The following arguments are optional: */ connectionId?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * ARN of the MAC Security (MACsec) secret key to associate with the dedicated connection. * * > **Note:** Supply either a CAK/CKN pair (using regular or write-only arguments) or `secretArn`. Do not combine key arguments with `secretArn`. */ secretArn?: pulumi.Input; /** * The date in UTC format that the MAC Security (MACsec) secret key takes effect. */ startOn?: pulumi.Input; /** * The state of the MAC Security (MACsec) secret key. The possible values are: associating, associated, disassociating, disassociated. See [MacSecKey](https://docs.aws.amazon.com/directconnect/latest/APIReference/API_MacSecKey.html#DX-Type-MacSecKey-state) for descriptions of each state. */ state?: pulumi.Input; } /** * The set of arguments for constructing a MacsecKeyAssociation resource. */ export interface MacsecKeyAssociationArgs { /** * MAC Security (MACsec) CAK to associate with the dedicated connection. Valid values are 64 hexadecimal characters (0-9, A-F). Required with `ckn` or `cknWo` unless `cakWo` is configured. Conflicts with `cakWo`. Changing this argument replaces the association. */ cak?: pulumi.Input; /** * **NOTE:** This field is write-only and its value will not be updated in state as part of read operations. * Write-only MAC Security (MACsec) CAK to associate with the dedicated connection. Valid values are 64 hexadecimal characters (0-9, A-F). Requires `cakWoVersion` and either `ckn` or `cknWo`. Conflicts with `cak` and `secretArn`. This value is not stored in the plan or state. */ cakWo?: pulumi.Input; /** * Positive integer used to trigger replacement when `cakWo` changes. Required with `cakWo`. Increment this value to replace the association using the current write-only values. */ cakWoVersion?: pulumi.Input; /** * MAC Security (MACsec) CKN to associate with the dedicated connection. Valid values are 64 hexadecimal characters (0-9, A-F). Required with `cak` or `cakWo` unless `cknWo` is configured. Conflicts with `cknWo`. Changing this argument replaces the association. */ ckn?: pulumi.Input; /** * **NOTE:** This field is write-only and its value will not be updated in state as part of read operations. * Write-only MAC Security (MACsec) CKN to associate with the dedicated connection. Valid values are 64 hexadecimal characters (0-9, A-F). Requires `cknWoVersion` and either `cak` or `cakWo`. Conflicts with `ckn` and `secretArn`. This value is not stored in the plan or state. */ cknWo?: pulumi.Input; /** * Positive integer used to trigger replacement when `cknWo` changes. Required with `cknWo`. Increment this value to replace the association using the current write-only values. */ cknWoVersion?: pulumi.Input; /** * ID of the dedicated Direct Connect connection. The connection must be a dedicated connection in the `AVAILABLE` state. * * The following arguments are optional: */ connectionId: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * ARN of the MAC Security (MACsec) secret key to associate with the dedicated connection. * * > **Note:** Supply either a CAK/CKN pair (using regular or write-only arguments) or `secretArn`. Do not combine key arguments with `secretArn`. */ secretArn?: pulumi.Input; } //# sourceMappingURL=macsecKeyAssociation.d.ts.map