Skip to content

Commit 5a4287b

Browse files
committed
Working MSK & Conduktor demo. Up to date docs
1 parent ff52feb commit 5a4287b

File tree

12 files changed

+1158
-994
lines changed

12 files changed

+1158
-994
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
hooks:
1919
- id: black
2020
- repo: https://github.com/pycqa/isort
21-
rev: 5.11.2
21+
rev: 5.11.4
2222
hooks:
2323
- id: isort
2424
args: [ "--profile", "black", "--filter-files" ]

CHANGELOG.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
History
33
=======
44

5-
0.0.1 (2022-04-24)
6-
------------------
5+
0.2.0 (2023-01-12)
6+
===================
77

8-
* First release on PyPI.
8+
Functional extension module for ecs-compose-x version 0.23. Allows for
9+
10+
* creation of a new MSK cluster
11+
* lookup to use an existing MSK cluster
12+
* link services to the cluster to get network and IAM/Kafka access to the cluster

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To install msk_cluster, run this command in your terminal:
1212

1313
.. code-block:: console
1414
15-
pip install ecs_composex_msk_cluster
15+
pip install ecs-composex-msk-cluster
1616
1717
This is the preferred method to install msk_cluster, as it will always install the most recent stable release.
1818

docs/kafka_access.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ There are 4 profiles to manage topics:
5454
* Consumer: allows to read data from the topic(s)
5555
* ProducerConsumer: allows both read and write access to the topic(s)
5656

57+
+-------------------------+-----------------------------+-----------------------------+-----------------------------+
58+
| Admin | Producer | Consumer | ProducerConsumer |
59+
+=========================+=============================+=============================+=============================+
60+
| kafka-cluster:*Topic* | kafka-cluster:DescribeTopic | kafka-cluster:DescribeTopic | kafka-cluster:DescribeTopic |
61+
| | | | |
62+
| | | | |
63+
| kafka-cluster:ReadData | kafka-cluster:WriteData | kafka-cluster:ReadData | kafka-cluster:WriteData |
64+
| | | | |
65+
| | | | |
66+
| kafka-cluster:WriteData | | | kafka-cluster:ReadData |
67+
+-------------------------+-----------------------------+-----------------------------+-----------------------------+
68+
69+
5770
group
5871
******
5972

@@ -62,13 +75,32 @@ There are 2 profiles to manage consumer groups
6275
* Admin: grants all Kafka ACLs on the security group, including delete
6376
* Consumer: grants normal use of the consumer group(s) for the application.
6477

78+
+-----------------------------+-----------------------------+
79+
| Admin | Consumer |
80+
+=============================+=============================+
81+
| kafka-cluster:DescribeGroup | kafka-cluster:DescribeGroup |
82+
| | |
83+
| kafka-cluster:AlterGroup | kafka-cluster:AlterGroup |
84+
| | |
85+
| kafka-cluster:DeleteGroup | |
86+
+-----------------------------+-----------------------------+
87+
6588
transactional-id
6689
*****************
6790

6891
There is 1 profile for Kafka transactional IDs.
6992

7093
* Producer: allows all Kafka ACLs related to Transactional IDs
7194

95+
+---------------------------------------+
96+
| Producer |
97+
+=======================================+
98+
| kafka-cluster:AlterTransactionalId |
99+
| |
100+
| |
101+
| kafka-cluster:DescribeTransactionalId |
102+
+---------------------------------------+
103+
72104
Schema Definition
73105
==================
74106

docs/syntax.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,17 @@ Lookup
4949
The Lookup for MSK allows to use an existing MSK Cluster and setup all the appropriate IAM permissions to access said
5050
cluster.
5151

52-
Additionally, you can set `ClientsSecurityGroup`_ which will allow you to automatically add an existing Security Group
52+
Lookup.Cluster
53+
---------------
54+
55+
Tags associated with the MSK cluster. The tags must point to a single cluster. If multiple clusters match with the given
56+
tags, the lookup will result in error.
57+
58+
59+
Lookup.ClientsSecurityGroup
60+
---------------------------
61+
62+
You can set ``ClientsSecurityGroup`` which will allow you to automatically add an existing Security Group
5363
which would have access to the MSK cluster in order to provide yourself with access to said cluster, on the network.
5464

5565
For example, the below Lookup will search for a cluster with tag **Name** and value **msk-lookup**. It will also
@@ -66,3 +76,5 @@ look for a security group to use for the services in addition to their new defau
6676
ClientsSecurityGroup:
6777
Tags:
6878
- aws:cloudformation:logical-id: newclusterClientsSecurityGroup
79+
80+
.. _Properties for MSK Cluster: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-msk-cluster.html

docs/usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Use the extension
1010
To use the extension, after installing the package, simply create a YAML file (or your existing compose file) and simply
1111
add ``x-msk_cluster``, to define new MSK clusters to create/lookup.
1212

13+
For example, deploy MSK Cluster & Conduktor to manage the resources within.
1314

1415
.. literalinclude:: ../use-cases/conduktor.yaml
1516
:language: yaml
@@ -20,5 +21,4 @@ Then we simply run the following command
2021

2122
.. code-block:: console
2223
23-
2424
ecs-compose-x render -d templates -n conduktor-msk-iam -f use-cases/conduktor.yaml

ecs_composex_msk_cluster/msk_cluster.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,20 @@
55

66
from typing import TYPE_CHECKING
77

8-
from compose_x_common.aws.msk import MSK_CLUSTER_ARN_RE
9-
from compose_x_common.compose_x_common import keyisset
10-
from ecs_composex.common import ComposeXSettings
11-
from ecs_composex.ingress_settings import lookup_security_group
12-
from troposphere.msk import Cluster as CfnMskCluster
13-
148
if TYPE_CHECKING:
159
from ecs_composex.mods_manager import XResourceModule
1610
from ecs_composex.common.settings import ComposeXSettings
1711
from ecs_composex.mods_manager import ModManager
1812

13+
from compose_x_common.aws.msk import MSK_CLUSTER_ARN_RE
14+
from compose_x_common.compose_x_common import keyisset
1915
from ecs_composex.common.logging import LOG
2016
from ecs_composex.compose.x_resources.network_x_resources import NetworkXResource
17+
from ecs_composex.ingress_settings import lookup_security_group
2118
from ecs_composex.resource_settings import link_resource_to_services
2219
from ecs_composex.vpc.vpc_params import STORAGE_SUBNETS
2320
from troposphere import GetAtt, Ref, Select, Split
21+
from troposphere.msk import Cluster as CfnMskCluster
2422

2523
from ecs_composex_msk_cluster.msk_cluster_params import (
2624
CONTROL_CLOUD_ATTR_MAPPING,

ecs_composex_msk_cluster/msk_cluster.spec.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)