Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions python-clusters/create-eks-cluster/cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@
"mandatory" : true,
"defaultValue" : true
},
{
"name": "enableCloudWatchPolicy",
"label": "Add CloudWatch policy",
"description": "Add CloudWatch IAM policy to cluster instances",
"type": "BOOLEAN",
"defaultValue": false
},
{
"name": "privateCluster",
"label": "Fully-private",
Expand Down
4 changes: 4 additions & 0 deletions python-clusters/create-eks-cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ def add_pre_bootstrap_commands(commands, yaml_dict):
commands = node_pool.get("preBootstrapCommands", "")
add_pre_bootstrap_commands(commands, yaml_dict)

if self.config.get('enableCloudWatchPolicy', True):
for node_pool_dict in yaml_dict['managedNodeGroups']:
node_pool_dict['iam']['withAddonPolicies']['cloudWatch'] = True

# whatever the setting, make the cluster from the yaml config
yaml_loc = os.path.join(os.getcwd(), self.cluster_id +'_config.yaml')
with open(yaml_loc, 'w') as outfile:
Expand Down