Skip to content

InstanceProfile

Source: src/AWS/IAM/InstanceProfile.ts

An IAM instance profile that can present a role to EC2 instances.

InstanceProfile bridges IAM roles into EC2 so compute instances can assume the attached role through the instance metadata service.

const role = yield* Role("InstanceRole", {
assumeRolePolicyDocument: {
Version: "2012-10-17",
Statement: [{
Effect: "Allow",
Principal: { Service: "ec2.amazonaws.com" },
Action: ["sts:AssumeRole"],
}],
},
});
const profile = yield* InstanceProfile("WebProfile", {
roleName: role.roleName,
});