Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using an auto-generated riff-raff.yaml file #947

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

akash1810
Copy link
Member

@akash1810 akash1810 commented Sep 19, 2024

What does this change?

Switch to using a riff-raff.yaml file generated by GuCDK.

Whilst this isn't strictly required, this is in preparation to switching to the newly released GuEc2AppExperimental.

Generated file content

allowedStages:
  - CODE
  - PROD
deployments:
  asg-upload-eu-west-1-deploy-prism:
    type: autoscaling
    actions:
      - uploadArtifacts
    regions:
      - eu-west-1
    stacks:
      - deploy
    app: prism
    parameters:
      bucketSsmLookup: true
      prefixApp: true
    contentDirectory: prism
  cfn-eu-west-1-deploy-prism:
    type: cloud-formation
    regions:
      - eu-west-1
    stacks:
      - deploy
    app: prism
    contentDirectory: cdk.out
    parameters:
      templateStagePaths:
        CODE: Prism-CODE.template.json
        PROD: Prism-PROD.template.json
      amiParametersToTags:
        AMIPrism:
          BuiltBy: amigo
          AmigoStage: PROD
          Recipe: arm64-focal-java11-deploy-infrastructure
          Encrypted: 'true'
    dependencies:
      - asg-upload-eu-west-1-deploy-prism
  asg-update-eu-west-1-deploy-prism:
    type: autoscaling
    actions:
      - deploy
    regions:
      - eu-west-1
    stacks:
      - deploy
    app: prism
    parameters:
      bucketSsmLookup: true
      prefixApp: true
    dependencies:
      - cfn-eu-west-1-deploy-prism
    contentDirectory: prism

How to test

Testing can be done by using the validation tool to understand the deployment graph, comparing the current (manual) and this (generated).

Ultimately, however, testing is done by deploying and seeing the correct AWS resources being effected:

  • The CloudFormation stack should be updated
  • The ASG should have its capacity doubled, then halved

Indeed, a deployment to CODE has been successful.

Comment on lines +23 to +25
env: {
region: 'eu-west-1',
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

riff-raff.yaml generation requires each stack to have the region explicitly set.

};

constructor(scope: App, id: string, props: PrismEc2AppProps) {
export class Prism extends GuStack {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The riff-raff.yaml generator uses the class name for the app property of the cloud-formation deployment type. Rename PrismEc2App to Prism as the app tag is prism not prism-ec2-app.

@akash1810 akash1810 merged commit 7aa7aba into main Oct 2, 2024
4 checks passed
@akash1810 akash1810 deleted the aa/riff-raff-yaml branch October 2, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants