Reputation: 101
I am trying to create a managed instance with AWS.
I followed this page to create the IAM role:https://docs.aws.amazon.com/systems-manager/latest/userguide/setup-instance-profile.html.
So it is AmazonSSMManagedInstanceCore
This is the code I am using to associate the IAM role with the EC2.
# Make EC2s with AWS Ubuntu 20
instances = subnet.create_instances(ImageId='ami-0885b1f6bd170450c',
InstanceType='m1.small',
MaxCount=num,
MinCount=num,
Monitoring={'Enabled': True},
SubnetId=subnet.subnet_id,
KeyName=key_name,
IamInstanceProfile={
'Arn': 'arn goes here',
},)
wait_until_running(instances)
And when I check in the console the role shows up.
But when I do
aws ssm describe-instance-information
I get
{
"InstanceInformationList": []
}
The ultimate goal here is to be able to send a command to the instance.
Upvotes: 1
Views: 83
Reputation: 238887
Based on the comments.
The instance does not have public IP address, which indicates it likely has no access to SSM service.
For SSM to work on your instance, it must be able to connect to the SSM service. This is usually enabled in one of three ways:
Upvotes: 1