|
| 1 | +apiVersion: scaffolder.backstage.io/v1beta3 |
| 2 | +kind: Template |
| 3 | +metadata: |
| 4 | + name: create-xqueue-claim |
| 5 | + title: Create XQueue Claim |
| 6 | + description: Creates a Crossplane XQueueClaim and opens a PR with the YAML. |
| 7 | +spec: |
| 8 | + owner: user:guest |
| 9 | + type: infrastructure |
| 10 | + |
| 11 | + parameters: |
| 12 | + - title: Queue Configuration |
| 13 | + required: [queueName, location, providerName] |
| 14 | + properties: |
| 15 | + queueName: |
| 16 | + type: string |
| 17 | + title: Queue name |
| 18 | + pattern: '^[a-z0-9]+(-[a-z0-9]+)*$' |
| 19 | + description: Must be in kebab-case (e.g. "my-queue-name") |
| 20 | + errorMessage: Queue name must be in kebab-case, using only lowercase letters, numbers, and hyphens (e.g. "my-queue-name") |
| 21 | + location: |
| 22 | + type: string |
| 23 | + title: Location |
| 24 | + enum: [EU, US] |
| 25 | + providerName: |
| 26 | + type: string |
| 27 | + title: Provider Name |
| 28 | + description: Select the provider to use for this queue. |
| 29 | + enum: |
| 30 | + - default |
| 31 | + enumNames: |
| 32 | + - Localstack |
| 33 | + visibilityTimeoutSeconds: |
| 34 | + type: integer |
| 35 | + title: Visibility Timeout |
| 36 | + default: 30 |
| 37 | + description: The duration (in seconds) that a received message is hidden from subsequent receive requests after being retrieved from the queue. |
| 38 | + maxMessageSize: |
| 39 | + type: integer |
| 40 | + title: Max Message Size (bytes) |
| 41 | + default: 262144 |
| 42 | + description: The limit of how many bytes a message can contain before being rejected. # Valid values: 1024 (1 KiB) to 262144 (256 KiB). |
| 43 | + tags: |
| 44 | + type: object |
| 45 | + title: Tags (optional) |
| 46 | + description: Key-value tags to help identify or categorize the queue. |
| 47 | + additionalProperties: |
| 48 | + type: string |
| 49 | + default: {} |
| 50 | + |
| 51 | + steps: |
| 52 | + - id: fetch-template |
| 53 | + name: Render local XQueueClaim template |
| 54 | + action: fetch:template |
| 55 | + input: |
| 56 | + url: ./skeleton |
| 57 | + targetPath: ./output |
| 58 | + values: |
| 59 | + queueName: ${{ parameters.queueName }} |
| 60 | + location: ${{ parameters.location }} |
| 61 | + providerName: ${{ parameters.providerName }} |
| 62 | + visibilityTimeoutSeconds: ${{ parameters.visibilityTimeoutSeconds }} |
| 63 | + maxMessageSize: ${{ parameters.maxMessageSize }} |
| 64 | + tags: ${{ parameters.tags }} |
| 65 | + |
| 66 | + - id: publish-pr |
| 67 | + name: Publish to GitHub |
| 68 | + action: publish:github:pull-request |
| 69 | + input: |
| 70 | + allowedHosts: ['github.com'] |
| 71 | + repoUrl: github.com?repo=platform-engineering-backstack&owner=wnqueiroz |
| 72 | + branchName: feature/add-xqueue-${{ parameters.queueName }} |
| 73 | + title: 'feat(xqueue): add claim for ${{ parameters.queueName }}' |
| 74 | + description: | |
| 75 | + This PR was automatically created via [Backstage Scaffolder](https://backstage.io/). |
| 76 | +
|
| 77 | + A new **XQueueClaim** has been scaffolded with the following configuration: |
| 78 | +
|
| 79 | + - **Queue Name**: `${{ parameters.queueName }}` |
| 80 | + - **Location**: `${{ parameters.location }}` |
| 81 | + - **Provider**: `${{ parameters.providerName }}` |
| 82 | + - **Visibility Timeout**: `${{ parameters.visibilityTimeoutSeconds }}s` |
| 83 | + - **Max Message Size**: `${{ parameters.maxMessageSize }} bytes` |
| 84 | +
|
| 85 | + > Tags and additional configuration can be found in the generated YAML file. |
| 86 | + sourcePath: ./output |
| 87 | + targetPath: crossplane/claims |
| 88 | + |
| 89 | + output: |
| 90 | + links: |
| 91 | + - title: View Pull Request |
| 92 | + icon: github |
| 93 | + url: ${{ steps['publish-pr'].output.remoteUrl }} |
0 commit comments