Skip to content

Latest commit

 

History

History

aws-classic-ts-sshkey

AWS SSHKEY and ACM CERT creation

AWS sshkey and acm cert creation in TypeScript

Requirements

pulumi 3.0 & Node.js 14.

Running the App

  1. Create a new stack

    pulumi stack init dev
  2. Restore npm dependencies

    npm install
  3. Set the AWS region location to use

    pulumi config set aws:region us-east-2
  4. Run pulumi up to preview and deploy changes via selecting y

    pulumi up
    Previewing update (dev)
    
    View Live: https://app.pulumi.com/myuser/aws-sshkey-ts/dev/previews/f244c0b0-2ba0-4b9a-9b25-c6b78f6d8c54
    
        Type                      Name                  Plan       
    +   pulumi:pulumi:Stack       aws-sshkey-ts-dev     create     
    +   ├─ tls:index:PrivateKey   demo-key-privatekey   create     
    +   └─ tls:index:CertRequest  demo-key-certrequest  create     
    
    Resources:
        + 3 to create
    
    Updating (dev)
    
    View Live: https://app.pulumi.com/myuser/aws-sshkey-ts/dev/updates/20
    
        Type                      Name                  Status      
    +   pulumi:pulumi:Stack       aws-sshkey-ts-dev     created     
    +   ├─ tls:index:PrivateKey   demo-key-privatekey   created     
    +   └─ tls:index:CertRequest  demo-key-certrequest  created     
    
    Outputs:
        certrequest_id                : "[secret]"
        certrequest_keyalgorithm      : "RSA"
        certrequest_pem               : "[secret]"
        certrequest_subjects          : [
            [0]: {
                commonName        : "democert"
                organization      : "demoorg"
            }
        ]
        sshkey_algorithm              : "RSA"
        sshkey_id                     : "[secret]"
        sshkey_privatekeypem          : "[secret]"
        sshkey_publickeyfingerprintmd5: "9a:2c:d6:e9:e2:c3:32:0c:c6:7f:e4:27:43:24:47:cc"
        sshkey_publickeyopenssh       : "[secret]"
    
    Resources:
        + 3 created
    
    Duration: 4s
  5. View the outputs.

    pulumi stack output

    Results

     Current stack outputs (9):
     OUTPUT                          VALUE
     certrequest_id                  [secret]
     certrequest_keyalgorithm        RSA
     certrequest_pem                 [secret]
     certrequest_subjects            [{"commonName":"democert","country":"","locality":"","organization":"pulumi","organizationalUnit":"","postalCode":"","province":"","serialNumber":"","streetAddresses":[]}]
     sshkey_algorithm                RSA
     sshkey_id                       [secret]
     sshkey_privatekeypem            [secret]
     sshkey_publickeyfingerprintmd5  c5:6a:11:1d:07:30:d9:b8:eb:cd:07:d4:18:02:d5:82
     sshkey_publickeyopenssh         [secret]

    If you need to see the value in secret, you will have to do the following

    pulumi stack output --show-secrets
  6. Run pulumi stack since we need the part appended to the pulumi console URL.

    pulumi stack
    More information at: https://app.pulumi.com/myuser/aws-sshkey-ts/dev

    We will need this: myuser/aws-sshkey-ts/dev

  7. Destroy the stack

    pulumi stack destroy -y
  8. Remove the stack. This will remove the Pulumi.dev.yaml file

    pulumi stack rm