copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Ability to reference the EFS volume in Cloud Formation / addons

Open tomkerswill opened this issue 3 years ago • 1 comments

Hi,

I am provisioning an EFS volume using the following type of thing in manifest.yml

storage:
  volumes:
    wp-content:
      path: /test/efs
      read_only: false
      efs: true

I'd like to be able to reference this in the addons functionality. As an example, we have a system that uses lambda to scale the IOPS of the EFS volume up and down, and so we'd like to write Cloud Formation templates in the addons directory to create CloudWatch alarms that reference the ID of the volume that CoPilot creates.

Is this possible? At the moment, we're struggling how we can reference those EFS volumes.

tomkerswill avatar Jun 08 '22 16:06 tomkerswill

Hi @tomkerswill !

To create the CloudWatch alarm are you looking for the volume ID or the EFS FileSystem ID ? Glancing at the CloudWatch metrics for EFS https://docs.aws.amazon.com/efs/latest/ug/efs-metrics.html I saw that they are namespaced by FileSystemId so I wanted to make sure.

  • If it's FileSystemId, Copilot exports the following output in the environment stack: https://github.com/aws/copilot-cli/blob/0bea71053c1f260ad4f832d7cb550353941f5d51/internal/pkg/template/templates/environment/cf.yml#L582-L587

It's possible to import it in addons using:

Fn::ImportValue:
          !Sub '${App}-${Env}-FilesystemID'
  • If it's another type of resource that's created in the service stack, perhaps this section of addons can help: https://aws.github.io/copilot-cli/docs/developing/additional-aws-resources/#customizing-the-parameters-section

Thank you!

efekarakus avatar Jun 08 '22 17:06 efekarakus

This issue is stale because it has been open 60 days with no response activity, and is tagged with pending/question. Remove the stale label, add a comment, or this will be closed in 14 days.

github-actions[bot] avatar Nov 26 '22 00:11 github-actions[bot]

This issue is closed due to inactivity. Feel free to reopen the issue if you have any follow-ups!

github-actions[bot] avatar Dec 10 '22 00:12 github-actions[bot]