arazzo: 1.0.1
info:
title: Amazon EC2 Rotate Key Pair
summary: Verify a key pair exists, create its replacement, then delete the old key pair.
description: >-
Rotates an SSH key pair without leaving a gap in coverage. The workflow
confirms the existing key pair is present, creates a new replacement key
pair, and only then deletes the old key pair. Every step spells out its
request inline using the Amazon EC2 query protocol (Action and Version
parameters) so the flow can be read and executed without opening the
underlying OpenAPI description.
version: 1.0.0
sourceDescriptions:
- name: keyPairsApi
url: ../openapi/amazon-ec2-key-pairs-api-openapi.yml
type: openapi
workflows:
- workflowId: rotate-key-pair
summary: Replace an existing SSH key pair with a freshly created one.
description: >-
Chains DescribeKeyPairs, CreateKeyPair, and DeleteKeyPair so the new key is
in place before the old key is removed.
inputs:
type: object
required:
- oldKeyName
- newKeyName
properties:
oldKeyName:
type: string
description: The name of the existing key pair to retire.
newKeyName:
type: string
description: The name for the replacement key pair.
steps:
- stepId: verifyOldKey
description: Confirm the existing key pair is present before rotating.
operationId: describeKeyPairs
parameters:
- name: Action
in: query
value: DescribeKeyPairs
- name: Version
in: query
value: '2016-11-15'
- name: KeyName
in: query
value: $inputs.oldKeyName
successCriteria:
- condition: $statusCode == 200
outputs:
verifyStatus: $statusCode
- stepId: createNewKey
description: Create the replacement key pair.
operationId: createKeyPair
parameters:
- name: Action
in: query
value: CreateKeyPair
- name: Version
in: query
value: '2016-11-15'
- name: KeyName
in: query
value: $inputs.newKeyName
- name: KeyType
in: query
value: ed25519
successCriteria:
- condition: $statusCode == 200
outputs:
createStatus: $statusCode
- stepId: deleteOldKey
description: Delete the retired key pair now that its replacement exists.
operationId: deleteKeyPair
parameters:
- name: Action
in: query
value: DeleteKeyPair
- name: Version
in: query
value: '2016-11-15'
- name: KeyName
in: query
value: $inputs.oldKeyName
successCriteria:
- condition: $statusCode == 200
outputs:
deleteStatus: $statusCode
outputs:
createStatus: $steps.createNewKey.outputs.createStatus
deleteStatus: $steps.deleteOldKey.outputs.deleteStatus
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.