Public bug reported:

The AWS-related environment variable `INSTANCE_ID` is not populated
within the context of a "runcmd", like it is for a "bootcmd". In
"bootcmd", the value is set to the AWS EC2 instance id, as obtained from
the metadata endpoint.

I reproduced this with a minimal cloud-init file:

```
#cloud-config

# bootcmd executes during the first boot only
bootcmd:
  - echo "INSTANCE_ID=$INSTANCE_ID" >> /tmp/bootcmd

# runcmd executes these lines during the initial boot
runcmd:
  - echo "INSTANCE_ID=$INSTANCE_ID" >> /tmp/runcmd
```

** Affects: cloud-init
     Importance: Undecided
         Status: New


** Tags: aws

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1760460

Title:
  INSTANCE_ID not available from "runcmd"

Status in cloud-init:
  New

Bug description:
  The AWS-related environment variable `INSTANCE_ID` is not populated
  within the context of a "runcmd", like it is for a "bootcmd". In
  "bootcmd", the value is set to the AWS EC2 instance id, as obtained
  from the metadata endpoint.

  I reproduced this with a minimal cloud-init file:

  ```
  #cloud-config

  # bootcmd executes during the first boot only
  bootcmd:
    - echo "INSTANCE_ID=$INSTANCE_ID" >> /tmp/bootcmd

  # runcmd executes these lines during the initial boot
  runcmd:
    - echo "INSTANCE_ID=$INSTANCE_ID" >> /tmp/runcmd
  ```

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1760460/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to