Skip to content

Commit 34de7da

Browse files
authored
docs(readme): rewrite some parts (#17)
* rewrite the english * update lambda role
1 parent cf7304a commit 34de7da

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
A lambda that add tags to the auto scaling groups of each k8s node.
1010

11-
It's user responsability to specify the cluster the pools and the tags for each pool, or specify it in the common tags, if you want the same tag for each node you want to process.
11+
You have to specify the cluster, the pools and the tags for each pool, or specify them in the common tags if you want the same tag for each node you want to process.
1212

1313
## How to use
1414

1515
### Push to AWS ECR
1616

17-
Our pipelines publish which new release to the docker hub, but in order to call it from a lambda, it needs to be in the AWS account of your private ECR.
17+
Our pipelines publish every new release to the docker hub, but in order to call it from a lambda, you have to push it to your AWS account private ECR.
1818

19-
Example, but you can tag it with the name you want:
19+
Example (take into account that you can tag it with the name you want):
2020

2121
```bash
2222
docker pull ydata/aws-asg-tags-lambda:1.0.0
@@ -26,12 +26,15 @@ docker push <your private ECR>/aws-asg-tags-lambda:1.0.0
2626

2727
### CloudFormation
2828

29-
The execution role, it's necessary to connect to the EKS and EC2 for the auto scaling groups
29+
The execution role is necessary to connect to the EKS and EC2 for the auto scaling groups
3030

3131
```yaml
32-
EKSASGTagLambdaExecutionRole:
32+
ASGTagLambdaExecutionRole:
3333
Type: AWS::IAM::Role
3434
Properties:
35+
RoleName: !Join
36+
- '-'
37+
- 'role'
3538
AssumeRolePolicyDocument:
3639
Version: '2012-10-17'
3740
Statement:
@@ -41,30 +44,29 @@ EKSASGTagLambdaExecutionRole:
4144
- lambda.amazonaws.com
4245
Action:
4346
- sts:AssumeRole
47+
ManagedPolicyArns:
48+
- arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole
4449
Policies:
4550
- PolicyName: !Join
4651
- '-'
47-
- - 'lambda-asg-tag'
48-
- !Ref IntegerSuffix
52+
- 'lambda-asg-tag'
4953
PolicyDocument:
5054
Version: '2012-10-17'
5155
Statement:
5256
- Effect: Allow
5357
Action:
5458
- eks:*
55-
- ec2:*
59+
- autoscaling:CreateOrUpdateTags
5660
Resource: '*'
57-
ManagedPolicyArns:
58-
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
5961
```
6062
6163
The declaration of the lambda function, which will be used by the invoke
6264
6365
```yaml
64-
EKSASGTagLambdaFunction:
66+
ASGTagLambdaFunction:
6567
Type: AWS::Lambda::Function
6668
Properties:
67-
Role: !GetAtt EKSASGTagLambdaExecutionRole.Arn
69+
Role: !GetAtt ASGTagLambdaExecutionRole.Arn
6870
PackageType: Image
6971
Code:
7072
ImageUri: !Ref EcrImageUri
@@ -77,12 +79,12 @@ EKSASGTagLambdaFunction:
7779
The lambda invokation
7880
7981
```yaml
80-
EKSASGTagLambdaInvoke:
82+
ASGTagLambdaInvoke:
8183
Type: AWS::CloudFormation::CustomResource
82-
DependsOn: EKSASGTagLambdaFunction
84+
DependsOn: ASGTagLambdaFunction
8385
Version: "1.0"
8486
Properties:
85-
ServiceToken: !GetAtt EKSASGTagLambdaFunction.Arn
87+
ServiceToken: !GetAtt ASGTagLambdaFunction.Arn
8688
StackID: !Ref AWS::StackId
8789
AccountID: !Ref AWS::AccountId
8890
Region: !Ref AWS::Region

0 commit comments

Comments
 (0)