user7268294
user7268294

Reputation: 101

Cloud9 and CloudFormation - access EC2 instance

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?

Upvotes: 0

Views: 351

Answers (1)

tyron
tyron

Reputation: 3865

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...

Upvotes: 1

Related Questions