File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -77,19 +77,10 @@ export class Ec2ConnectionManager {
77
77
}
78
78
}
79
79
80
- // public async hasProperPolicies(IamRoleArn: string): Promise<boolean> {
81
- // const attachedPolicies = (await this.iamClient.listAttachedRolePolicies(IamRoleArn)).map(
82
- // policy => policy.PolicyName!
83
- // )
84
- // const requiredPolicies = ['AmazonSSMManagedInstanceCore', 'AmazonSSMManagedEC2InstanceDefaultPolicy']
85
-
86
- // return requiredPolicies.length !== 0 && requiredPolicies.every(policy => attachedPolicies.includes(policy))
87
- // }
88
-
89
80
public async hasProperPermissions ( IamRoleArn : string ) : Promise < boolean > {
90
81
const deniedActions = await getDeniedSsmActions ( this . iamClient , IamRoleArn )
91
82
92
- return deniedActions . length ! == 0
83
+ return deniedActions . length = == 0
93
84
}
94
85
95
86
public async isInstanceRunning ( instanceId : string ) : Promise < boolean > {
@@ -119,9 +110,9 @@ export class Ec2ConnectionManager {
119
110
this . throwConnectionError ( message , selection , { code : 'EC2SSMPermission' } )
120
111
}
121
112
122
- const hasProperPolicies = await this . hasProperPermissions ( IamRole ! . Arn )
113
+ const hasPermission = await this . hasProperPermissions ( IamRole ! . Arn )
123
114
124
- if ( ! hasProperPolicies ) {
115
+ if ( ! hasPermission ) {
125
116
const message = `Ensure an IAM role with the required policies is attached to the instance. Found attached role: ${
126
117
IamRole ! . Arn
127
118
} `
You can’t perform that action at this time.
0 commit comments