|
| 1 | +Parameters: |
| 2 | + PreCreatedSubnetOne: |
| 3 | + Type: String |
| 4 | + PreCreatedSubnetTwo: |
| 5 | + Type: String |
| 6 | + MskClusterName4: |
| 7 | + Type: String |
| 8 | + |
| 9 | +Resources: |
| 10 | + MyLambdaExecutionRole: |
| 11 | + Type: AWS::IAM::Role |
| 12 | + Properties: |
| 13 | + AssumeRolePolicyDocument: |
| 14 | + Version: '2012-10-17' |
| 15 | + Statement: |
| 16 | + - Action: [sts:AssumeRole] |
| 17 | + Effect: Allow |
| 18 | + Principal: |
| 19 | + Service: [lambda.amazonaws.com] |
| 20 | + Policies: |
| 21 | + - PolicyName: IntegrationTestExecution |
| 22 | + PolicyDocument: |
| 23 | + Statement: |
| 24 | + - Action: [kafka:DescribeCluster, kafka:GetBootstrapBrokers, ec2:CreateNetworkInterface, |
| 25 | + ec2:DescribeNetworkInterfaces, ec2:DescribeVpcs, ec2:DeleteNetworkInterface, |
| 26 | + ec2:DescribeSubnets, ec2:DescribeSecurityGroups, logs:CreateLogGroup, |
| 27 | + logs:CreateLogStream, logs:PutLogEvents, s3:ListBucket, kafka:DescribeClusterV2] |
| 28 | + Effect: Allow |
| 29 | + Resource: '*' |
| 30 | + ManagedPolicyArns: |
| 31 | + - !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole |
| 32 | + Tags: |
| 33 | + - {Value: SAM, Key: lambda:createdBy} |
| 34 | + |
| 35 | + MyMskCluster: |
| 36 | + Type: AWS::MSK::Cluster |
| 37 | + Properties: |
| 38 | + BrokerNodeGroupInfo: |
| 39 | + ClientSubnets: |
| 40 | + - Ref: PreCreatedSubnetOne |
| 41 | + - Ref: PreCreatedSubnetTwo |
| 42 | + InstanceType: kafka.t3.small |
| 43 | + StorageInfo: |
| 44 | + EBSStorageInfo: |
| 45 | + VolumeSize: 1 |
| 46 | + ClusterName: |
| 47 | + Ref: MskClusterName4 |
| 48 | + KafkaVersion: 3.8.x |
| 49 | + NumberOfBrokerNodes: 2 |
| 50 | + |
| 51 | + MyMskStreamProcessor: |
| 52 | + Type: AWS::Serverless::Function |
| 53 | + Properties: |
| 54 | + Runtime: nodejs18.x |
| 55 | + Handler: index.handler |
| 56 | + CodeUri: ${codeuri} |
| 57 | + Role: |
| 58 | + Fn::GetAtt: [MyLambdaExecutionRole, Arn] |
| 59 | + Events: |
| 60 | + MyMskEvent: |
| 61 | + Type: MSK |
| 62 | + Properties: |
| 63 | + StartingPosition: LATEST |
| 64 | + Stream: |
| 65 | + Ref: MyMskCluster |
| 66 | + Topics: |
| 67 | + - SchemaRegistryTestTopic |
| 68 | + ProvisionedPollerConfig: |
| 69 | + MinimumPollers: 1 |
| 70 | + SchemaRegistryConfig: |
| 71 | + AccessConfigs: |
| 72 | + - Type: BASIC_AUTH |
| 73 | + URI: !Sub arn:${AWS::Partition}:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c |
| 74 | + SchemaValidationConfigs: |
| 75 | + - Attribute: KEY |
| 76 | + EventRecordFormat: JSON |
| 77 | + SchemaRegistryURI: https://confluent.us-east-2.aws.confluent.cloud:9092 |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + PreCreatedS3Bucket: |
| 82 | + Type: AWS::S3::Bucket |
| 83 | + DeletionPolicy: Delete |
| 84 | + |
| 85 | +Metadata: |
| 86 | + SamTransformTest: true |
0 commit comments