-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEKS-cluster-attack.yaml
61 lines (61 loc) · 2.21 KB
/
EKS-cluster-attack.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
AWSTemplateFormatVersion: '2010-09-09'
Resources:
EKSFisRole:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://test-public-access-sharabesh.s3.amazonaws.com/IAM-fis-role.yaml
ControlPaneIAMRole:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://test-public-access-sharabesh.s3.amazonaws.com/iam-role-cfn.yaml
ControlPaneSecurityGroup:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://test-public-access-sharabesh.s3.amazonaws.com/security-group.yaml
EKSCluster:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://test-public-access-sharabesh.s3.amazonaws.com/eks-cluster.yaml
Parameters:
ControlPlaneSecurityGroup: !GetAtt [ControlPaneSecurityGroup, Outputs.ControlPlaneSecurityGroup]
ControlPlaneIAMRoleArn: !GetAtt [ControlPaneIAMRole, Outputs.ControlPlaneRole]
DependsOn:
- ControlPaneIAMRole
- ControlPaneSecurityGroup
EKSNodeGroup:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://test-public-access-sharabesh.s3.amazonaws.com/eks-nodegroup.yaml
Parameters:
ClusterControlPlaneSecurityGroup: !GetAtt [ControlPaneSecurityGroup, Outputs.ControlPlaneSecurityGroup]
NodeInstanceProfile: !GetAtt [ControlPaneIAMRole, Outputs.NodeInstanceProfile]
NodeSecurityGroup: !GetAtt [ControlPaneSecurityGroup, Outputs.NodeSecurityGroup]
DependsOn:
- EKSCluster
EKSClusterAttackExperiment:
Type: AWS::FIS::ExperimentTemplate
Properties:
Actions:
EKS-Terminate-nodes:
ActionId: aws:eks:terminate-nodegroup-instance
Parameters:
InstanceTerminationPercentage: 50
Targets:
Clusters: Cluster-Target-1
Description: EKS Cluster terminate nodes
RoleArn: !GetAtt [EKSFisRole, Outputs.RoleArn]
Tags:
AWS_FIS_POC: ""
Targets:
cluster-Target-1:
ResourceTags:
AWS_FIS_POC: ""
ResourceType: aws:eks:nodegroup
SelectionMode: ALL
StopConditions:
- Source: none
DependsOn:
- EKSNodeGroup
Outputs:
ExperimentTemplateId:
Value: !Ref 'EKSClusterAttackExperiment'