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

Does copilot scheduled job support map type

Open jhtann opened this issue 2 years ago • 4 comments

Currently, the copilot job only support string type which must be one of 'public' or 'private'. However, we have the need to specify the subnets as what the Copilot backend service is.

Would appreciate it if this were added to the roadmap!

link -> https://aws.github.io/copilot-cli/docs/manifest/scheduled-job/

jhtann avatar Feb 28 '24 03:02 jhtann

oops network.vpc.placement.subnets is actually supported! The documentation is out-of-date. Thanks for bringing this to our attention. Try it out and let me know if it works for you!

Lou1415926 avatar Feb 28 '24 20:02 Lou1415926

tried, seem cannot :(

we use copilot version: v1.33.1

the manifest:

type: Scheduled Job

network:
  connect: true # Enable Service Connect for intra-environment traffic between services.
  vpc:
    # placement: private # THIS will be replaced using patch overrides to value due to Job not supported subnets MAP type
    placement:
      subnets: ["SubnetID1", "SubnetID2"]

the error we got:

CfnSynthesisError: Resolution error: Supplied properties not correct for "CfnStateMachineProps"
  definitionSubstitutions: element 'Subnets': ["SubnetID1","SubnetID2"] should be a string.

looks like the value not escaped

jhtann avatar Feb 29 '24 01:02 jhtann

oh you are right! Sent out a fix so that we are passing in a string that indicates the list of subnets to job. I think this should fix the problem.

Lou1415926 avatar Feb 29 '24 23:02 Lou1415926

Hello @jhtann ! Fix is now released in Copilot v1.33.2 https://github.com/aws/copilot-cli/releases/tag/v1.33.2 🎉🚀

KollaAdithya avatar Mar 21 '24 18:03 KollaAdithya