0

I'm creating a cloud9 instance in cloudformation as follows:

Resources:
  DevEnv:
    Type: 'AWS::Cloud9::EnvironmentEC2'
    Properties:
      SubnetId: !Ref PublicSubnet
      Name: MyEnvironment
      InstanceType: !Ref Cloud9InstanceType

Subsequently, I want to run a bash script on that EC2 instance (within the cloudformation script) to set it up properly. How do I do that?

user7268294
  • 101
  • 1
  • 4

1 Answers1

1

Unfortunately you can't. AWS::Cloud9::EnvironmentEC2 doesn't expose UserData or something like that and you cannot run SSM Documents against Cloud9 instances.

The closest you can get is using Repositories to clone a AWS CodeCommit into the instance, and that repository has a script that you run manually first time you connect...

tyron
  • 3,715
  • 1
  • 22
  • 36