File tree 5 files changed +9
-2
lines changed
5 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ AWS_REGION="YOUR-AWS-REGION"
48
48
AWS_AMI_ID="ami-022e1a32d3f742bd8"
49
49
# The EC2 instance role to access S3
50
50
AWS_ROLE_ARN="YOUR-AWS-ROLE-ARN"
51
+ # The IAM instance profile for the EC2 instance to assume
52
+ AWS_INSTANCE_PROFILE_ARN="YOUR-AWS-INSTANCE-PROFILE-ARN"
51
53
52
54
### AUTHENTICATION ###
53
55
### These configs are related to the authentication of users.
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ export const getAWSVariables = (): AWSVariables => {
34
34
! process . env . AWS_SECRET_ACCESS_KEY ||
35
35
! process . env . AWS_REGION ||
36
36
! process . env . AWS_ROLE_ARN ||
37
+ ! process . env . AWS_INSTANCE_PROFILE_ARN ||
37
38
! process . env . AWS_AMI_ID
38
39
)
39
40
throw new Error (
@@ -45,6 +46,7 @@ export const getAWSVariables = (): AWSVariables => {
45
46
secretAccessKey : process . env . AWS_SECRET_ACCESS_KEY ! ,
46
47
region : process . env . AWS_REGION || "us-east-1" ,
47
48
roleArn : process . env . AWS_ROLE_ARN ! ,
49
+ instanceProfileArn : process . env . AWS_INSTANCE_PROFILE_ARN ! ,
48
50
amiId : process . env . AWS_AMI_ID !
49
51
}
50
52
}
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ export const createEC2Instance = async (
153
153
diskType : DiskTypeForVM
154
154
) : Promise < EC2Instance > => {
155
155
// Get the AWS variables.
156
- const { amiId, roleArn } = getAWSVariables ( )
156
+ const { amiId, instanceProfileArn } = getAWSVariables ( )
157
157
158
158
// Parametrize the VM EC2 instance.
159
159
const params : RunInstancesCommandInput = {
@@ -163,7 +163,7 @@ export const createEC2Instance = async (
163
163
MinCount : 1 ,
164
164
// nb. to find this: iam -> roles -> role_name.
165
165
IamInstanceProfile : {
166
- Arn : roleArn
166
+ Arn : instanceProfileArn
167
167
} ,
168
168
// nb. for running commands at the startup.
169
169
UserData : Buffer . from ( commands . join ( "\n" ) ) . toString ( "base64" ) ,
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export type AWSVariables = {
25
25
secretAccessKey : string
26
26
region : string
27
27
roleArn : string
28
+ instanceProfileArn : string
28
29
amiId : string
29
30
}
30
31
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ AWS_CEREMONY_BUCKET_POSTFIX="-ph2-ceremony"
16
16
AWS_AMI_ID = " ami-022e1a32d3f742bd8"
17
17
# The EC2 instance role to access S3
18
18
AWS_ROLE_ARN = " YOUR-AWS-ROLE-ARN"
19
+ # The IAM instance profile for the EC2 instance to assume
20
+ AWS_INSTANCE_PROFILE_ARN = " YOUR-AWS-INSTANCE-PROFILE-ARN"
19
21
# The SNS topic ARN to publish notifications
20
22
AWS_SNS_TOPIC_ARN = " YOUR-AWS-SNS-TOPIC-ARN"
21
23
You can’t perform that action at this time.
0 commit comments