Cloud

Amazon Web Services

There are many components within Redpanda Connect which utilize AWS services. You will find that each of these components contains a configuration section under the field credentials, of the format:

credentials:
  profile: ""
  id: ""
  secret: ""
  token: ""
  role: ""
  role_external_id: ""

This section contains many fields and it isn’t immediately clear which of them are compulsory and which aren’t. This document aims to make it clear what each field is responsible for and how it might be used.

Credentials

By explicitly setting the credentials you are using at the component level it’s possible to connect to components using different accounts within the same Redpanda Connect process.

If you are using long term credentials for your account you only need to set the fields id and secret:

credentials:
  id: foo     # aws_access_key_id
  secret: bar # aws_secret_access_key

If you are using short term credentials then you will also need to set the field token:

credentials:
  id: foo     # aws_access_key_id
  secret: bar # aws_secret_access_key
  token: baz  # aws_session_token

Use the pipeline IAM role on BYOC clusters on AWS

On Bring Your Own Cloud (BYOC) clusters on AWS, pipelines can authenticate to AWS with an IAM role in your AWS account, so you don’t need to store access keys. Redpanda enables this on request. To turn it on, contact Redpanda Support.

Dedicated clusters, Serverless clusters, and BYOC clusters on Google Cloud Platform (GCP) or Azure don’t support the pipeline IAM role. On these clusters, use explicit id and secret credentials, and store them as secrets.

When the pipeline IAM role is on, every pipeline on the cluster runs as this IAM role in your AWS account:

arn:aws:iam::<aws-account-id>:role/redpanda-<cluster-id>-redpanda-connect-pipeline

Replace the following placeholders:

  • <aws-account-id>: The ID of the AWS account that hosts the cluster

  • <cluster-id>: The ID of your Redpanda Cloud cluster

Grant the role access to your AWS resources

The role has no access to your AWS resources beyond the cluster’s own Redpanda Connect secrets until you give it access. Attach a customer-managed IAM policy to the role:

aws iam attach-role-policy \
  --role-name redpanda-<cluster-id>-redpanda-connect-pipeline \
  --policy-arn arn:aws:iam::<aws-account-id>:policy/<policy-name>

Replace <policy-name> with the name of your customer-managed policy.

Follow these rules when you attach policies:

  • Grant only the access that the pipelines on the cluster need. Every pipeline on the cluster uses the same role, so every pipeline gets the access that you attach.

  • Use customer-managed policies, not inline policies. When you delete the cluster, Redpanda detaches the managed policies and then deletes the role. An inline policy blocks the deletion of the role. Redpanda doesn’t delete your managed policies.

  • On a BYOC cluster in your own VPC (BYOVPC), your permissions boundary still limits what the role can do.

Redpanda doesn’t remove the policies that you attach, so they stay attached when Redpanda updates the cluster.

Configure the pipeline

To use the pipeline IAM role, omit the credentials section, or leave id, secret, and token empty. For example, this output writes to Amazon S3 with the role:

output:
  aws_s3:
    bucket: <bucket-name>
    path: ${! counter() }.json
    region: <aws-region>

Replace the following placeholders:

  • <bucket-name>: The name of your S3 bucket

  • <aws-region>: The AWS region of the bucket

Assume a role

It’s also possible to configure Redpanda Connect to assume a role using your credentials by setting the field role to your target role ARN.

credentials:
  role: fooarn # Role ARN

This does NOT require explicit credentials, but it’s possible to use both.

On BYOC clusters on AWS with the pipeline IAM role, a pipeline uses the role to assume your target role:

  • If the target role is in the same AWS account as the cluster, the target role’s trust policy must name the ARN of the pipeline IAM role.

  • If the target role is in another AWS account, the target role’s trust policy must name the ARN of the pipeline IAM role. You must also attach a policy to the pipeline IAM role that allows sts:AssumeRole on the target role.

The role field assumes one role. It doesn’t chain several roles.

On other clusters, set explicit id and secret credentials for an IAM identity that you own and that has permission to assume the target role, and make sure the target role’s trust policy trusts that identity. Store these credentials as secrets.

If you need to assume a role owned by another organization they might require you to provide an external ID, in which case place it in the field role_external_id:

credentials:
  role: fooarn # Role ARN
  role_external_id: bar_id