cftemplates/MSKBastionKafkaClientInstance.yml [90:127]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            su -c "echo 'export PS1=\"KafkaClientEC2Instance [\u@\h \W\\]$ \"' >> /home/ec2-user/.bash_profile" -s /bin/sh ec2-user
            su -c "echo '[ -f /tmp/kafka/setup_env ] && . /tmp/kafka/setup_env' >> /home/ec2-user/.bash_profile" -s /bin/sh ec2-user

            #setup aws Region
            su -c "mkdir -p /home/ec2-user/.aws" -s /bin/sh ec2-user
            su -c "cat > /home/ec2-user/.aws/config<<EOF
            [default]
            region = ${AWS::Region}
            EOF" -s /bin/sh ec2-user

  EC2Role: 
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument: 
        Version: 2012-10-17
        Statement:
          - Sid: ''
            Effect: Allow
            Principal:
              Service: ec2.amazonaws.com
            Action: 'sts:AssumeRole'
      Path: "/"
     
  EC2InstanceProfile:
    Type: AWS::IAM::InstanceProfile
    Properties: 
      Roles:
        - !Ref EC2Role

  KafkaClientEC2InstancePolicy:
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyName: KafkaClientEC2InstancePolicy
      PolicyDocument:
        Version: 2012-10-17
        Statement:
          - Effect: Allow
            Action:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



cftemplates/MSKBastionKafkaClientInstanceLatestAMISasl.yml [148:185]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            su -c "echo 'export PS1=\"KafkaClientEC2Instance [\u@\h \W\\]$ \"' >> /home/ec2-user/.bash_profile" -s /bin/sh ec2-user
            su -c "echo '[ -f /tmp/kafka/setup_env ] && . /tmp/kafka/setup_env' >> /home/ec2-user/.bash_profile" -s /bin/sh ec2-user

            #setup aws Region
            su -c "mkdir -p /home/ec2-user/.aws" -s /bin/sh ec2-user
            su -c "cat > /home/ec2-user/.aws/config<<EOF
            [default]
            region = ${AWS::Region}
            EOF" -s /bin/sh ec2-user

  EC2Role: 
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument: 
        Version: 2012-10-17
        Statement:
          - Sid: ''
            Effect: Allow
            Principal:
              Service: ec2.amazonaws.com
            Action: 'sts:AssumeRole'
      Path: "/"
      
  EC2InstanceProfile:
    Type: AWS::IAM::InstanceProfile
    Properties: 
      Roles:
        - !Ref EC2Role

  KafkaClientEC2InstancePolicy:
    Type: 'AWS::IAM::Policy'
    Properties:
      PolicyName: KafkaClientEC2InstancePolicy
      PolicyDocument:
        Version: 2012-10-17
        Statement:
          - Effect: Allow
            Action:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



