github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/kms/key.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package kms 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Manages a single-Region or multi-Region primary KMS key. 15 // 16 // > **NOTE on KMS Key Policy:** KMS Key Policy can be configured in either the standalone resource `kms.KeyPolicy` 17 // or with the parameter `policy` in this resource. 18 // Configuring with both will cause inconsistencies and may overwrite configuration. 19 // 20 // ## Example Usage 21 // 22 // <!--Start PulumiCodeChooser --> 23 // ```go 24 // package main 25 // 26 // import ( 27 // 28 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms" 29 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 30 // 31 // ) 32 // 33 // func main() { 34 // pulumi.Run(func(ctx *pulumi.Context) error { 35 // _, err := kms.NewKey(ctx, "a", &kms.KeyArgs{ 36 // Description: pulumi.String("KMS key 1"), 37 // DeletionWindowInDays: pulumi.Int(10), 38 // }) 39 // if err != nil { 40 // return err 41 // } 42 // return nil 43 // }) 44 // } 45 // 46 // ``` 47 // <!--End PulumiCodeChooser --> 48 // 49 // ## Import 50 // 51 // Using `pulumi import`, import KMS Keys using the `id`. For example: 52 // 53 // ```sh 54 // $ pulumi import aws:kms/key:Key a 1234abcd-12ab-34cd-56ef-1234567890ab 55 // ``` 56 type Key struct { 57 pulumi.CustomResourceState 58 59 // The Amazon Resource Name (ARN) of the key. 60 Arn pulumi.StringOutput `pulumi:"arn"` 61 // A flag to indicate whether to bypass the key policy lockout safety check. 62 // Setting this value to true increases the risk that the KMS key becomes unmanageable. Do not set this value to true indiscriminately. 63 // For more information, refer to the scenario in the [Default Key Policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) section in the _AWS Key Management Service Developer Guide_. 64 // The default value is `false`. 65 BypassPolicyLockoutSafetyCheck pulumi.BoolPtrOutput `pulumi:"bypassPolicyLockoutSafetyCheck"` 66 // ID of the KMS [Custom Key Store](https://docs.aws.amazon.com/kms/latest/developerguide/create-cmk-keystore.html) where the key will be stored instead of KMS (eg CloudHSM). 67 CustomKeyStoreId pulumi.StringPtrOutput `pulumi:"customKeyStoreId"` 68 // Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. 69 // Valid values: `SYMMETRIC_DEFAULT`, `RSA_2048`, `RSA_3072`, `RSA_4096`, `HMAC_256`, `ECC_NIST_P256`, `ECC_NIST_P384`, `ECC_NIST_P521`, or `ECC_SECG_P256K1`. Defaults to `SYMMETRIC_DEFAULT`. For help with choosing a key spec, see the [AWS KMS Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html). 70 CustomerMasterKeySpec pulumi.StringPtrOutput `pulumi:"customerMasterKeySpec"` 71 // The waiting period, specified in number of days. After the waiting period ends, AWS KMS deletes the KMS key. 72 // If you specify a value, it must be between `7` and `30`, inclusive. If you do not specify a value, it defaults to `30`. 73 // If the KMS key is a multi-Region primary key with replicas, the waiting period begins when the last of its replica keys is deleted. Otherwise, the waiting period begins immediately. 74 DeletionWindowInDays pulumi.IntPtrOutput `pulumi:"deletionWindowInDays"` 75 // The description of the key as viewed in AWS console. 76 Description pulumi.StringOutput `pulumi:"description"` 77 // Specifies whether [key rotation](http://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) is enabled. Defaults to `false`. 78 EnableKeyRotation pulumi.BoolPtrOutput `pulumi:"enableKeyRotation"` 79 // Specifies whether the key is enabled. Defaults to `true`. 80 IsEnabled pulumi.BoolPtrOutput `pulumi:"isEnabled"` 81 // The globally unique identifier for the key. 82 KeyId pulumi.StringOutput `pulumi:"keyId"` 83 // Specifies the intended use of the key. Valid values: `ENCRYPT_DECRYPT`, `SIGN_VERIFY`, or `GENERATE_VERIFY_MAC`. 84 // Defaults to `ENCRYPT_DECRYPT`. 85 KeyUsage pulumi.StringPtrOutput `pulumi:"keyUsage"` 86 // Indicates whether the KMS key is a multi-Region (`true`) or regional (`false`) key. Defaults to `false`. 87 MultiRegion pulumi.BoolOutput `pulumi:"multiRegion"` 88 // A valid policy JSON document. Although this is a key policy, not an IAM policy, an `iam.getPolicyDocument`, in the form that designates a principal, can be used. 89 // 90 // > **NOTE:** Note: All KMS keys must have a key policy. If a key policy is not specified, AWS gives the KMS key a [default key policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) that gives all principals in the owning account unlimited access to all KMS operations for the key. This default key policy effectively delegates all access control to IAM policies and KMS grants. 91 Policy pulumi.StringOutput `pulumi:"policy"` 92 // A map of tags to assign to the object. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 93 Tags pulumi.StringMapOutput `pulumi:"tags"` 94 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 95 // 96 // Deprecated: Please use `tags` instead. 97 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 98 // Identifies the external key that serves as key material for the KMS key in an external key store. 99 XksKeyId pulumi.StringPtrOutput `pulumi:"xksKeyId"` 100 } 101 102 // NewKey registers a new resource with the given unique name, arguments, and options. 103 func NewKey(ctx *pulumi.Context, 104 name string, args *KeyArgs, opts ...pulumi.ResourceOption) (*Key, error) { 105 if args == nil { 106 args = &KeyArgs{} 107 } 108 109 opts = internal.PkgResourceDefaultOpts(opts) 110 var resource Key 111 err := ctx.RegisterResource("aws:kms/key:Key", name, args, &resource, opts...) 112 if err != nil { 113 return nil, err 114 } 115 return &resource, nil 116 } 117 118 // GetKey gets an existing Key resource's state with the given name, ID, and optional 119 // state properties that are used to uniquely qualify the lookup (nil if not required). 120 func GetKey(ctx *pulumi.Context, 121 name string, id pulumi.IDInput, state *KeyState, opts ...pulumi.ResourceOption) (*Key, error) { 122 var resource Key 123 err := ctx.ReadResource("aws:kms/key:Key", name, id, state, &resource, opts...) 124 if err != nil { 125 return nil, err 126 } 127 return &resource, nil 128 } 129 130 // Input properties used for looking up and filtering Key resources. 131 type keyState struct { 132 // The Amazon Resource Name (ARN) of the key. 133 Arn *string `pulumi:"arn"` 134 // A flag to indicate whether to bypass the key policy lockout safety check. 135 // Setting this value to true increases the risk that the KMS key becomes unmanageable. Do not set this value to true indiscriminately. 136 // For more information, refer to the scenario in the [Default Key Policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) section in the _AWS Key Management Service Developer Guide_. 137 // The default value is `false`. 138 BypassPolicyLockoutSafetyCheck *bool `pulumi:"bypassPolicyLockoutSafetyCheck"` 139 // ID of the KMS [Custom Key Store](https://docs.aws.amazon.com/kms/latest/developerguide/create-cmk-keystore.html) where the key will be stored instead of KMS (eg CloudHSM). 140 CustomKeyStoreId *string `pulumi:"customKeyStoreId"` 141 // Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. 142 // Valid values: `SYMMETRIC_DEFAULT`, `RSA_2048`, `RSA_3072`, `RSA_4096`, `HMAC_256`, `ECC_NIST_P256`, `ECC_NIST_P384`, `ECC_NIST_P521`, or `ECC_SECG_P256K1`. Defaults to `SYMMETRIC_DEFAULT`. For help with choosing a key spec, see the [AWS KMS Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html). 143 CustomerMasterKeySpec *string `pulumi:"customerMasterKeySpec"` 144 // The waiting period, specified in number of days. After the waiting period ends, AWS KMS deletes the KMS key. 145 // If you specify a value, it must be between `7` and `30`, inclusive. If you do not specify a value, it defaults to `30`. 146 // If the KMS key is a multi-Region primary key with replicas, the waiting period begins when the last of its replica keys is deleted. Otherwise, the waiting period begins immediately. 147 DeletionWindowInDays *int `pulumi:"deletionWindowInDays"` 148 // The description of the key as viewed in AWS console. 149 Description *string `pulumi:"description"` 150 // Specifies whether [key rotation](http://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) is enabled. Defaults to `false`. 151 EnableKeyRotation *bool `pulumi:"enableKeyRotation"` 152 // Specifies whether the key is enabled. Defaults to `true`. 153 IsEnabled *bool `pulumi:"isEnabled"` 154 // The globally unique identifier for the key. 155 KeyId *string `pulumi:"keyId"` 156 // Specifies the intended use of the key. Valid values: `ENCRYPT_DECRYPT`, `SIGN_VERIFY`, or `GENERATE_VERIFY_MAC`. 157 // Defaults to `ENCRYPT_DECRYPT`. 158 KeyUsage *string `pulumi:"keyUsage"` 159 // Indicates whether the KMS key is a multi-Region (`true`) or regional (`false`) key. Defaults to `false`. 160 MultiRegion *bool `pulumi:"multiRegion"` 161 // A valid policy JSON document. Although this is a key policy, not an IAM policy, an `iam.getPolicyDocument`, in the form that designates a principal, can be used. 162 // 163 // > **NOTE:** Note: All KMS keys must have a key policy. If a key policy is not specified, AWS gives the KMS key a [default key policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) that gives all principals in the owning account unlimited access to all KMS operations for the key. This default key policy effectively delegates all access control to IAM policies and KMS grants. 164 Policy *string `pulumi:"policy"` 165 // A map of tags to assign to the object. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 166 Tags map[string]string `pulumi:"tags"` 167 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 168 // 169 // Deprecated: Please use `tags` instead. 170 TagsAll map[string]string `pulumi:"tagsAll"` 171 // Identifies the external key that serves as key material for the KMS key in an external key store. 172 XksKeyId *string `pulumi:"xksKeyId"` 173 } 174 175 type KeyState struct { 176 // The Amazon Resource Name (ARN) of the key. 177 Arn pulumi.StringPtrInput 178 // A flag to indicate whether to bypass the key policy lockout safety check. 179 // Setting this value to true increases the risk that the KMS key becomes unmanageable. Do not set this value to true indiscriminately. 180 // For more information, refer to the scenario in the [Default Key Policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) section in the _AWS Key Management Service Developer Guide_. 181 // The default value is `false`. 182 BypassPolicyLockoutSafetyCheck pulumi.BoolPtrInput 183 // ID of the KMS [Custom Key Store](https://docs.aws.amazon.com/kms/latest/developerguide/create-cmk-keystore.html) where the key will be stored instead of KMS (eg CloudHSM). 184 CustomKeyStoreId pulumi.StringPtrInput 185 // Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. 186 // Valid values: `SYMMETRIC_DEFAULT`, `RSA_2048`, `RSA_3072`, `RSA_4096`, `HMAC_256`, `ECC_NIST_P256`, `ECC_NIST_P384`, `ECC_NIST_P521`, or `ECC_SECG_P256K1`. Defaults to `SYMMETRIC_DEFAULT`. For help with choosing a key spec, see the [AWS KMS Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html). 187 CustomerMasterKeySpec pulumi.StringPtrInput 188 // The waiting period, specified in number of days. After the waiting period ends, AWS KMS deletes the KMS key. 189 // If you specify a value, it must be between `7` and `30`, inclusive. If you do not specify a value, it defaults to `30`. 190 // If the KMS key is a multi-Region primary key with replicas, the waiting period begins when the last of its replica keys is deleted. Otherwise, the waiting period begins immediately. 191 DeletionWindowInDays pulumi.IntPtrInput 192 // The description of the key as viewed in AWS console. 193 Description pulumi.StringPtrInput 194 // Specifies whether [key rotation](http://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) is enabled. Defaults to `false`. 195 EnableKeyRotation pulumi.BoolPtrInput 196 // Specifies whether the key is enabled. Defaults to `true`. 197 IsEnabled pulumi.BoolPtrInput 198 // The globally unique identifier for the key. 199 KeyId pulumi.StringPtrInput 200 // Specifies the intended use of the key. Valid values: `ENCRYPT_DECRYPT`, `SIGN_VERIFY`, or `GENERATE_VERIFY_MAC`. 201 // Defaults to `ENCRYPT_DECRYPT`. 202 KeyUsage pulumi.StringPtrInput 203 // Indicates whether the KMS key is a multi-Region (`true`) or regional (`false`) key. Defaults to `false`. 204 MultiRegion pulumi.BoolPtrInput 205 // A valid policy JSON document. Although this is a key policy, not an IAM policy, an `iam.getPolicyDocument`, in the form that designates a principal, can be used. 206 // 207 // > **NOTE:** Note: All KMS keys must have a key policy. If a key policy is not specified, AWS gives the KMS key a [default key policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) that gives all principals in the owning account unlimited access to all KMS operations for the key. This default key policy effectively delegates all access control to IAM policies and KMS grants. 208 Policy pulumi.StringPtrInput 209 // A map of tags to assign to the object. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 210 Tags pulumi.StringMapInput 211 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 212 // 213 // Deprecated: Please use `tags` instead. 214 TagsAll pulumi.StringMapInput 215 // Identifies the external key that serves as key material for the KMS key in an external key store. 216 XksKeyId pulumi.StringPtrInput 217 } 218 219 func (KeyState) ElementType() reflect.Type { 220 return reflect.TypeOf((*keyState)(nil)).Elem() 221 } 222 223 type keyArgs struct { 224 // A flag to indicate whether to bypass the key policy lockout safety check. 225 // Setting this value to true increases the risk that the KMS key becomes unmanageable. Do not set this value to true indiscriminately. 226 // For more information, refer to the scenario in the [Default Key Policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) section in the _AWS Key Management Service Developer Guide_. 227 // The default value is `false`. 228 BypassPolicyLockoutSafetyCheck *bool `pulumi:"bypassPolicyLockoutSafetyCheck"` 229 // ID of the KMS [Custom Key Store](https://docs.aws.amazon.com/kms/latest/developerguide/create-cmk-keystore.html) where the key will be stored instead of KMS (eg CloudHSM). 230 CustomKeyStoreId *string `pulumi:"customKeyStoreId"` 231 // Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. 232 // Valid values: `SYMMETRIC_DEFAULT`, `RSA_2048`, `RSA_3072`, `RSA_4096`, `HMAC_256`, `ECC_NIST_P256`, `ECC_NIST_P384`, `ECC_NIST_P521`, or `ECC_SECG_P256K1`. Defaults to `SYMMETRIC_DEFAULT`. For help with choosing a key spec, see the [AWS KMS Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html). 233 CustomerMasterKeySpec *string `pulumi:"customerMasterKeySpec"` 234 // The waiting period, specified in number of days. After the waiting period ends, AWS KMS deletes the KMS key. 235 // If you specify a value, it must be between `7` and `30`, inclusive. If you do not specify a value, it defaults to `30`. 236 // If the KMS key is a multi-Region primary key with replicas, the waiting period begins when the last of its replica keys is deleted. Otherwise, the waiting period begins immediately. 237 DeletionWindowInDays *int `pulumi:"deletionWindowInDays"` 238 // The description of the key as viewed in AWS console. 239 Description *string `pulumi:"description"` 240 // Specifies whether [key rotation](http://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) is enabled. Defaults to `false`. 241 EnableKeyRotation *bool `pulumi:"enableKeyRotation"` 242 // Specifies whether the key is enabled. Defaults to `true`. 243 IsEnabled *bool `pulumi:"isEnabled"` 244 // Specifies the intended use of the key. Valid values: `ENCRYPT_DECRYPT`, `SIGN_VERIFY`, or `GENERATE_VERIFY_MAC`. 245 // Defaults to `ENCRYPT_DECRYPT`. 246 KeyUsage *string `pulumi:"keyUsage"` 247 // Indicates whether the KMS key is a multi-Region (`true`) or regional (`false`) key. Defaults to `false`. 248 MultiRegion *bool `pulumi:"multiRegion"` 249 // A valid policy JSON document. Although this is a key policy, not an IAM policy, an `iam.getPolicyDocument`, in the form that designates a principal, can be used. 250 // 251 // > **NOTE:** Note: All KMS keys must have a key policy. If a key policy is not specified, AWS gives the KMS key a [default key policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) that gives all principals in the owning account unlimited access to all KMS operations for the key. This default key policy effectively delegates all access control to IAM policies and KMS grants. 252 Policy *string `pulumi:"policy"` 253 // A map of tags to assign to the object. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 254 Tags map[string]string `pulumi:"tags"` 255 // Identifies the external key that serves as key material for the KMS key in an external key store. 256 XksKeyId *string `pulumi:"xksKeyId"` 257 } 258 259 // The set of arguments for constructing a Key resource. 260 type KeyArgs struct { 261 // A flag to indicate whether to bypass the key policy lockout safety check. 262 // Setting this value to true increases the risk that the KMS key becomes unmanageable. Do not set this value to true indiscriminately. 263 // For more information, refer to the scenario in the [Default Key Policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) section in the _AWS Key Management Service Developer Guide_. 264 // The default value is `false`. 265 BypassPolicyLockoutSafetyCheck pulumi.BoolPtrInput 266 // ID of the KMS [Custom Key Store](https://docs.aws.amazon.com/kms/latest/developerguide/create-cmk-keystore.html) where the key will be stored instead of KMS (eg CloudHSM). 267 CustomKeyStoreId pulumi.StringPtrInput 268 // Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. 269 // Valid values: `SYMMETRIC_DEFAULT`, `RSA_2048`, `RSA_3072`, `RSA_4096`, `HMAC_256`, `ECC_NIST_P256`, `ECC_NIST_P384`, `ECC_NIST_P521`, or `ECC_SECG_P256K1`. Defaults to `SYMMETRIC_DEFAULT`. For help with choosing a key spec, see the [AWS KMS Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html). 270 CustomerMasterKeySpec pulumi.StringPtrInput 271 // The waiting period, specified in number of days. After the waiting period ends, AWS KMS deletes the KMS key. 272 // If you specify a value, it must be between `7` and `30`, inclusive. If you do not specify a value, it defaults to `30`. 273 // If the KMS key is a multi-Region primary key with replicas, the waiting period begins when the last of its replica keys is deleted. Otherwise, the waiting period begins immediately. 274 DeletionWindowInDays pulumi.IntPtrInput 275 // The description of the key as viewed in AWS console. 276 Description pulumi.StringPtrInput 277 // Specifies whether [key rotation](http://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) is enabled. Defaults to `false`. 278 EnableKeyRotation pulumi.BoolPtrInput 279 // Specifies whether the key is enabled. Defaults to `true`. 280 IsEnabled pulumi.BoolPtrInput 281 // Specifies the intended use of the key. Valid values: `ENCRYPT_DECRYPT`, `SIGN_VERIFY`, or `GENERATE_VERIFY_MAC`. 282 // Defaults to `ENCRYPT_DECRYPT`. 283 KeyUsage pulumi.StringPtrInput 284 // Indicates whether the KMS key is a multi-Region (`true`) or regional (`false`) key. Defaults to `false`. 285 MultiRegion pulumi.BoolPtrInput 286 // A valid policy JSON document. Although this is a key policy, not an IAM policy, an `iam.getPolicyDocument`, in the form that designates a principal, can be used. 287 // 288 // > **NOTE:** Note: All KMS keys must have a key policy. If a key policy is not specified, AWS gives the KMS key a [default key policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) that gives all principals in the owning account unlimited access to all KMS operations for the key. This default key policy effectively delegates all access control to IAM policies and KMS grants. 289 Policy pulumi.StringPtrInput 290 // A map of tags to assign to the object. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 291 Tags pulumi.StringMapInput 292 // Identifies the external key that serves as key material for the KMS key in an external key store. 293 XksKeyId pulumi.StringPtrInput 294 } 295 296 func (KeyArgs) ElementType() reflect.Type { 297 return reflect.TypeOf((*keyArgs)(nil)).Elem() 298 } 299 300 type KeyInput interface { 301 pulumi.Input 302 303 ToKeyOutput() KeyOutput 304 ToKeyOutputWithContext(ctx context.Context) KeyOutput 305 } 306 307 func (*Key) ElementType() reflect.Type { 308 return reflect.TypeOf((**Key)(nil)).Elem() 309 } 310 311 func (i *Key) ToKeyOutput() KeyOutput { 312 return i.ToKeyOutputWithContext(context.Background()) 313 } 314 315 func (i *Key) ToKeyOutputWithContext(ctx context.Context) KeyOutput { 316 return pulumi.ToOutputWithContext(ctx, i).(KeyOutput) 317 } 318 319 // KeyArrayInput is an input type that accepts KeyArray and KeyArrayOutput values. 320 // You can construct a concrete instance of `KeyArrayInput` via: 321 // 322 // KeyArray{ KeyArgs{...} } 323 type KeyArrayInput interface { 324 pulumi.Input 325 326 ToKeyArrayOutput() KeyArrayOutput 327 ToKeyArrayOutputWithContext(context.Context) KeyArrayOutput 328 } 329 330 type KeyArray []KeyInput 331 332 func (KeyArray) ElementType() reflect.Type { 333 return reflect.TypeOf((*[]*Key)(nil)).Elem() 334 } 335 336 func (i KeyArray) ToKeyArrayOutput() KeyArrayOutput { 337 return i.ToKeyArrayOutputWithContext(context.Background()) 338 } 339 340 func (i KeyArray) ToKeyArrayOutputWithContext(ctx context.Context) KeyArrayOutput { 341 return pulumi.ToOutputWithContext(ctx, i).(KeyArrayOutput) 342 } 343 344 // KeyMapInput is an input type that accepts KeyMap and KeyMapOutput values. 345 // You can construct a concrete instance of `KeyMapInput` via: 346 // 347 // KeyMap{ "key": KeyArgs{...} } 348 type KeyMapInput interface { 349 pulumi.Input 350 351 ToKeyMapOutput() KeyMapOutput 352 ToKeyMapOutputWithContext(context.Context) KeyMapOutput 353 } 354 355 type KeyMap map[string]KeyInput 356 357 func (KeyMap) ElementType() reflect.Type { 358 return reflect.TypeOf((*map[string]*Key)(nil)).Elem() 359 } 360 361 func (i KeyMap) ToKeyMapOutput() KeyMapOutput { 362 return i.ToKeyMapOutputWithContext(context.Background()) 363 } 364 365 func (i KeyMap) ToKeyMapOutputWithContext(ctx context.Context) KeyMapOutput { 366 return pulumi.ToOutputWithContext(ctx, i).(KeyMapOutput) 367 } 368 369 type KeyOutput struct{ *pulumi.OutputState } 370 371 func (KeyOutput) ElementType() reflect.Type { 372 return reflect.TypeOf((**Key)(nil)).Elem() 373 } 374 375 func (o KeyOutput) ToKeyOutput() KeyOutput { 376 return o 377 } 378 379 func (o KeyOutput) ToKeyOutputWithContext(ctx context.Context) KeyOutput { 380 return o 381 } 382 383 // The Amazon Resource Name (ARN) of the key. 384 func (o KeyOutput) Arn() pulumi.StringOutput { 385 return o.ApplyT(func(v *Key) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 386 } 387 388 // A flag to indicate whether to bypass the key policy lockout safety check. 389 // Setting this value to true increases the risk that the KMS key becomes unmanageable. Do not set this value to true indiscriminately. 390 // For more information, refer to the scenario in the [Default Key Policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) section in the _AWS Key Management Service Developer Guide_. 391 // The default value is `false`. 392 func (o KeyOutput) BypassPolicyLockoutSafetyCheck() pulumi.BoolPtrOutput { 393 return o.ApplyT(func(v *Key) pulumi.BoolPtrOutput { return v.BypassPolicyLockoutSafetyCheck }).(pulumi.BoolPtrOutput) 394 } 395 396 // ID of the KMS [Custom Key Store](https://docs.aws.amazon.com/kms/latest/developerguide/create-cmk-keystore.html) where the key will be stored instead of KMS (eg CloudHSM). 397 func (o KeyOutput) CustomKeyStoreId() pulumi.StringPtrOutput { 398 return o.ApplyT(func(v *Key) pulumi.StringPtrOutput { return v.CustomKeyStoreId }).(pulumi.StringPtrOutput) 399 } 400 401 // Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. 402 // Valid values: `SYMMETRIC_DEFAULT`, `RSA_2048`, `RSA_3072`, `RSA_4096`, `HMAC_256`, `ECC_NIST_P256`, `ECC_NIST_P384`, `ECC_NIST_P521`, or `ECC_SECG_P256K1`. Defaults to `SYMMETRIC_DEFAULT`. For help with choosing a key spec, see the [AWS KMS Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html). 403 func (o KeyOutput) CustomerMasterKeySpec() pulumi.StringPtrOutput { 404 return o.ApplyT(func(v *Key) pulumi.StringPtrOutput { return v.CustomerMasterKeySpec }).(pulumi.StringPtrOutput) 405 } 406 407 // The waiting period, specified in number of days. After the waiting period ends, AWS KMS deletes the KMS key. 408 // If you specify a value, it must be between `7` and `30`, inclusive. If you do not specify a value, it defaults to `30`. 409 // If the KMS key is a multi-Region primary key with replicas, the waiting period begins when the last of its replica keys is deleted. Otherwise, the waiting period begins immediately. 410 func (o KeyOutput) DeletionWindowInDays() pulumi.IntPtrOutput { 411 return o.ApplyT(func(v *Key) pulumi.IntPtrOutput { return v.DeletionWindowInDays }).(pulumi.IntPtrOutput) 412 } 413 414 // The description of the key as viewed in AWS console. 415 func (o KeyOutput) Description() pulumi.StringOutput { 416 return o.ApplyT(func(v *Key) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput) 417 } 418 419 // Specifies whether [key rotation](http://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) is enabled. Defaults to `false`. 420 func (o KeyOutput) EnableKeyRotation() pulumi.BoolPtrOutput { 421 return o.ApplyT(func(v *Key) pulumi.BoolPtrOutput { return v.EnableKeyRotation }).(pulumi.BoolPtrOutput) 422 } 423 424 // Specifies whether the key is enabled. Defaults to `true`. 425 func (o KeyOutput) IsEnabled() pulumi.BoolPtrOutput { 426 return o.ApplyT(func(v *Key) pulumi.BoolPtrOutput { return v.IsEnabled }).(pulumi.BoolPtrOutput) 427 } 428 429 // The globally unique identifier for the key. 430 func (o KeyOutput) KeyId() pulumi.StringOutput { 431 return o.ApplyT(func(v *Key) pulumi.StringOutput { return v.KeyId }).(pulumi.StringOutput) 432 } 433 434 // Specifies the intended use of the key. Valid values: `ENCRYPT_DECRYPT`, `SIGN_VERIFY`, or `GENERATE_VERIFY_MAC`. 435 // Defaults to `ENCRYPT_DECRYPT`. 436 func (o KeyOutput) KeyUsage() pulumi.StringPtrOutput { 437 return o.ApplyT(func(v *Key) pulumi.StringPtrOutput { return v.KeyUsage }).(pulumi.StringPtrOutput) 438 } 439 440 // Indicates whether the KMS key is a multi-Region (`true`) or regional (`false`) key. Defaults to `false`. 441 func (o KeyOutput) MultiRegion() pulumi.BoolOutput { 442 return o.ApplyT(func(v *Key) pulumi.BoolOutput { return v.MultiRegion }).(pulumi.BoolOutput) 443 } 444 445 // A valid policy JSON document. Although this is a key policy, not an IAM policy, an `iam.getPolicyDocument`, in the form that designates a principal, can be used. 446 // 447 // > **NOTE:** Note: All KMS keys must have a key policy. If a key policy is not specified, AWS gives the KMS key a [default key policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) that gives all principals in the owning account unlimited access to all KMS operations for the key. This default key policy effectively delegates all access control to IAM policies and KMS grants. 448 func (o KeyOutput) Policy() pulumi.StringOutput { 449 return o.ApplyT(func(v *Key) pulumi.StringOutput { return v.Policy }).(pulumi.StringOutput) 450 } 451 452 // A map of tags to assign to the object. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 453 func (o KeyOutput) Tags() pulumi.StringMapOutput { 454 return o.ApplyT(func(v *Key) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 455 } 456 457 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 458 // 459 // Deprecated: Please use `tags` instead. 460 func (o KeyOutput) TagsAll() pulumi.StringMapOutput { 461 return o.ApplyT(func(v *Key) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 462 } 463 464 // Identifies the external key that serves as key material for the KMS key in an external key store. 465 func (o KeyOutput) XksKeyId() pulumi.StringPtrOutput { 466 return o.ApplyT(func(v *Key) pulumi.StringPtrOutput { return v.XksKeyId }).(pulumi.StringPtrOutput) 467 } 468 469 type KeyArrayOutput struct{ *pulumi.OutputState } 470 471 func (KeyArrayOutput) ElementType() reflect.Type { 472 return reflect.TypeOf((*[]*Key)(nil)).Elem() 473 } 474 475 func (o KeyArrayOutput) ToKeyArrayOutput() KeyArrayOutput { 476 return o 477 } 478 479 func (o KeyArrayOutput) ToKeyArrayOutputWithContext(ctx context.Context) KeyArrayOutput { 480 return o 481 } 482 483 func (o KeyArrayOutput) Index(i pulumi.IntInput) KeyOutput { 484 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Key { 485 return vs[0].([]*Key)[vs[1].(int)] 486 }).(KeyOutput) 487 } 488 489 type KeyMapOutput struct{ *pulumi.OutputState } 490 491 func (KeyMapOutput) ElementType() reflect.Type { 492 return reflect.TypeOf((*map[string]*Key)(nil)).Elem() 493 } 494 495 func (o KeyMapOutput) ToKeyMapOutput() KeyMapOutput { 496 return o 497 } 498 499 func (o KeyMapOutput) ToKeyMapOutputWithContext(ctx context.Context) KeyMapOutput { 500 return o 501 } 502 503 func (o KeyMapOutput) MapIndex(k pulumi.StringInput) KeyOutput { 504 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Key { 505 return vs[0].(map[string]*Key)[vs[1].(string)] 506 }).(KeyOutput) 507 } 508 509 func init() { 510 pulumi.RegisterInputType(reflect.TypeOf((*KeyInput)(nil)).Elem(), &Key{}) 511 pulumi.RegisterInputType(reflect.TypeOf((*KeyArrayInput)(nil)).Elem(), KeyArray{}) 512 pulumi.RegisterInputType(reflect.TypeOf((*KeyMapInput)(nil)).Elem(), KeyMap{}) 513 pulumi.RegisterOutputType(KeyOutput{}) 514 pulumi.RegisterOutputType(KeyArrayOutput{}) 515 pulumi.RegisterOutputType(KeyMapOutput{}) 516 }