|
| 1 | +--- |
| 2 | +# Documentation generated by "gen/generator.go"; DO NOT EDIT. |
| 3 | +# In order to regenerate this file execute `go generate` from the repository root. |
| 4 | +# More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). |
| 5 | +subcategory: "Access Policies" |
| 6 | +layout: "aci" |
| 7 | +page_title: "ACI: aci_macsec_key" |
| 8 | +sidebar_current: "docs-aci-resource-aci_macsec_key" |
| 9 | +description: |- |
| 10 | + Manages ACI MACsec Key |
| 11 | +--- |
| 12 | + |
| 13 | +# aci_macsec_key # |
| 14 | + |
| 15 | +Manages ACI MACsec Key |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +## API Information ## |
| 20 | + |
| 21 | +* Class: [macsecKeyPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/macsecKeyPol/overview) |
| 22 | + |
| 23 | +* Supported in ACI versions: 3.1(1i) and later. |
| 24 | + |
| 25 | +* Distinguished Name Formats: |
| 26 | + - `uni/fabric/macsecpcontfab/keychainp-{name}/keyp-{keyName}` |
| 27 | + - `uni/infra/macsecpcont/keychainp-{name}/keyp-{keyName}` |
| 28 | + |
| 29 | +## GUI Information ## |
| 30 | + |
| 31 | +* Locations: |
| 32 | + - `Fabric -> Access Policies -> Policies -> Interface -> MACSec -> MACSec KeyChain Policies -> MACSec Key Policy` |
| 33 | + - `Fabric -> Fabric Policies -> Policies -> MACSec -> MACSec KeyChain Policies -> MACSec Key Policy` |
| 34 | + |
| 35 | +## Example Usage ## |
| 36 | + |
| 37 | +The configuration snippet below creates a MACsec Key with only required attributes. |
| 38 | + |
| 39 | +```hcl |
| 40 | +
|
| 41 | +resource "aci_macsec_key" "example_macsec_key_chain" { |
| 42 | + parent_dn = aci_macsec_key_chain.example.id |
| 43 | + key_name = "aa" |
| 44 | +} |
| 45 | +
|
| 46 | +``` |
| 47 | +The configuration snippet below shows all possible attributes of the MACsec Key. |
| 48 | + |
| 49 | +!> This example might not be valid configuration and is only used to show all possible attributes. |
| 50 | + |
| 51 | +```hcl |
| 52 | +
|
| 53 | +resource "aci_macsec_key" "full_example_macsec_key_chain" { |
| 54 | + parent_dn = aci_macsec_key_chain.example.id |
| 55 | + annotation = "annotation" |
| 56 | + description = "description_1" |
| 57 | + end_time = "infinite" |
| 58 | + key_name = "aa" |
| 59 | + name = "name_1" |
| 60 | + name_alias = "name_alias_1" |
| 61 | + owner_key = "owner_key_1" |
| 62 | + owner_tag = "owner_tag_1" |
| 63 | + pre_shared_key = "123456789a223456789a323456789abc" |
| 64 | + start_time = "2025-11-28T03:12:09.452-08:00" |
| 65 | + annotations = [ |
| 66 | + { |
| 67 | + key = "key_0" |
| 68 | + value = "value_1" |
| 69 | + } |
| 70 | + ] |
| 71 | + tags = [ |
| 72 | + { |
| 73 | + key = "key_0" |
| 74 | + value = "value_1" |
| 75 | + } |
| 76 | + ] |
| 77 | +} |
| 78 | +
|
| 79 | +``` |
| 80 | + |
| 81 | +All examples for the MACsec Key resource can be found in the [examples](https://github.com/CiscoDevNet/terraform-provider-aci/tree/master/examples/resources/aci_macsec_key) folder. |
| 82 | + |
| 83 | +## Schema ## |
| 84 | + |
| 85 | +### Required ### |
| 86 | + |
| 87 | +* `parent_dn` - (string) The distinguished name (DN) of the parent object, possible resources: |
| 88 | + - [aci_macsec_key_chain](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/macsec_key_chain) ([macsecKeyChainPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/macsecKeyChainPol/overview)) |
| 89 | +* `key_name` (keyName) - (string) The key name of the MACsec Key object. |
| 90 | + |
| 91 | +### Read-Only ### |
| 92 | + |
| 93 | +* `id` - (string) The distinguished name (DN) of the MACsec Key object. |
| 94 | + |
| 95 | +### Optional ### |
| 96 | + |
| 97 | +* `annotation` (annotation) - (string) The annotation of the MACsec Key object. This attribute is supported in ACI versions: 3.2(1l) and later. |
| 98 | + - Default: `"orchestrator:terraform"` |
| 99 | +* `description` (descr) - (string) The description of the MACsec Key object. |
| 100 | +* `end_time` (endTime) - (string) The end time of the MACsec Key object. The default value cannot be used directly, since APIC will calculate this value to the datetime representation which results in a applied state that does not match the planned state. Do not provide this attribute when APIC should calculate the current datetime ('now'). Furthermore, make sure that the time-zone part (in the full example this is '-08:00') matches the time-zone configured on APIC. Not doing so will result in unexpected behaviour. |
| 101 | + - Default: `"infinite"` |
| 102 | +* `name` (name) - (string) The name of the MACsec Key object. |
| 103 | +* `name_alias` (nameAlias) - (string) The name alias of the MACsec Key object. |
| 104 | +* `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. |
| 105 | +* `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. |
| 106 | +* `pre_shared_key` (preSharedKey) - (string) The pre-shared key of the MACsec Key object. |
| 107 | +* `start_time` (startTime) - (string) The start time of the MACsec Key object. Please make sure that the time-zone part (in the full example this is '-08:00') matches the time-zone configured on APIC. Not doing so will result in unexpected behaviour. |
| 108 | + - Default: `"now"` |
| 109 | +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. |
| 110 | + #### Required #### |
| 111 | + |
| 112 | + * `key` (key) - (string) The key used to uniquely identify this configuration object. |
| 113 | + * `value` (value) - (string) The value of the property. |
| 114 | +* `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. |
| 115 | + #### Required #### |
| 116 | + |
| 117 | + * `key` (key) - (string) The key used to uniquely identify this configuration object. |
| 118 | + * `value` (value) - (string) The value of the property. |
| 119 | + |
| 120 | +## Importing |
| 121 | + |
| 122 | +An existing MACsec Key can be [imported](https://www.terraform.io/docs/import/index.html) into this resource with its distinguished name (DN), via the following command: |
| 123 | + |
| 124 | +``` |
| 125 | +terraform import aci_macsec_key.example_macsec_key_chain uni/fabric/macsecpcontfab/keychainp-{name}/keyp-{keyName} |
| 126 | +``` |
| 127 | + |
| 128 | +Starting in Terraform version 1.5, an existing MACsec Key can be imported |
| 129 | +using [import blocks](https://developer.hashicorp.com/terraform/language/import) via the following configuration: |
| 130 | + |
| 131 | +``` |
| 132 | +import { |
| 133 | + id = "uni/fabric/macsecpcontfab/keychainp-{name}/keyp-{keyName}" |
| 134 | + to = aci_macsec_key.example_macsec_key_chain |
| 135 | +} |
| 136 | +``` |
0 commit comments