Categorygithub.com/acorn-io/aws/kms/key
package
0.2.0
Repository: https://github.com/acorn-io/aws.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

KMS Key Service Acorn

This Service Acorn creates a CloudFormation stack containing the given KMS Key.

Limitations

Currently, this Service Acorn only supports adding a single ARN as an admin for the key.

Usage

Running the Acorn

acorn run ghcr.io/acorn-io/aws/kms/key:v0.1.0 \
  --key-name="my-key" \
  --key-alias="my-key" \
  --admin-arn="<arn>" \
  --description="Example key for encryption and decryption" \
  --key-spec="RSA_4098" \
  --key-usage="ENCRYPT_DECRYPT" \
  --pending-window-days=10 \
  --key-policy @policy.json

Using the service in an Acornfile

services: key: {
    image: "ghcr.io/acorn-io/aws/kms/key:v0.1.0"
    serviceArgs: {
        keyName:           "my-key"
        keyAlias:          "my-key"
        adminArn:          "<arn>"
        description:       "Example key for encryption and decryption"
        keySpec:           "RSA_4098"
        keyUsage:          "ENCRYPT_DECRYPT"
        pendingWindowDays: 10
        tags: "my-tag": "my-tag-value"

        // This is an example policy:
        keyPolicy: {
            Version: "2012-10-07"
            Statement: [
                {
                    Effect: "Allow"
                    Principal: AWS: "arn:aws:iam::<account ID>:root"
                    Action:   "kms:*"
                    Resource: "*"
                },
            ]
        }
    }
}

containers: mycontainer: {
    image:    "<image>"
    consumes: ["key"]
    env: KEY_ARN: "@{services.key.data.arn}"
}

Arguments

NameDescriptionRequiredDefault
--key-nameThe name of the key in the CloudFormation stack.No(generated)
--key-aliasThe alias (friendly name) to give to the key.No@{acorn.name}-@{acorn.account}-@{acorn.project}
--admin-arnThe ARN of a user to set as the administrator of the key. You can specify AWS accounts, IAM users, Federated SAML users, IAM roles, and specific assumed-role sessions.No(none)
--descriptionDescription to attach to the key.No"Acorn created KMS Key"
--key-specThe type of key to create.YesSYMMETRIC_DEFAULT
--key-usageThe usage of the key. Each key spec only supports certain usages. See table below for details.YesENCRYPT_DECRYPT
--pending-window-daysThe time (in days) that must pass after key deletion is requested before the key is deleted. Must be between 7 and 30 (inclusive)Yes7
--key-policyThe key policy to attach to the key. This must be in JSON format.No(created by AWS)
--tagsTags to attach to the key.No(none)

Key Specs and Usages

Key SpecSupported Key Usages
SYMMETRIC_DEFAULTENCRYPT_DECRYPT
RSA_2048ENCRYPT_DECRYPT, SIGN_VERIFY
RSA_3072ENCRYPT_DECRYPT, SIGN_VERIFY
RSA_4096ENCRYPT_DECRYPT, SIGN_VERIFY
ECC_NIST_P256SIGN_VERIFY
ECC_NIST_P384SIGN_VERIFY
ECC_NIST_P521SIGN_VERIFY
ECC_SECG_P256K1SIGN_VERIFY
HMAC_224GENERATE_VERIFY_MAC
HMAC_256GENERATE_VERIFY_MAC
HMAC_384GENERATE_VERIFY_MAC
HMAC_512GENERATE_VERIFY_MAC

Source: https://pkg.go.dev/github.com/aws/aws-cdk-go/awscdk/v2/[email protected]#KeySpec

Outputs

NameDescription
arnThe ARN of the created key.