As cloud environments evolve, so must the security measures that protect them. With Confluent’s latest enhancement—AWS IAM role integration for managed connectors—you can now adopt temporary security credentials, reducing both the risk of long-term credential exposure and the operational burden of key management. This feature tightens security and simplifies access management for your data flows between AWS and Confluent Cloud.
AWS Identity and Access Management (IAM) securely manages identities and access to AWS services and resources, and scales workload and workforce access. IAM roles provide a way to access AWS by relying on temporary security credentials. Each role has a set of permissions for making AWS service requests, and a role is not associated with a specific user or group. Instead, trusted entities such as identity providers or AWS services assume roles.
You can use roles to delegate access to users, applications, or services that don't normally have access to your AWS resources, but rely on short-term credentials. Authorized identities, which can be AWS services or users from your identity provider, can assume roles to make AWS requests.
Confluent Cloud Provider Integration offers identity and access management (IAM) role-based authorization that lets you adopt the temporary security credentials of an IAM role, which acts as a set of permission policies. Trusted entities, such as IAM users, applications, or cloud services can assume this role. Using this approach, you can create a secure access connection between source or sink resources on AWS and Confluent Cloud for data ingestion or transfer.
As of today, the Confluent Cloud Provider Integration is available as a part of the Confluent Cloud API. Using the REST API, you can map AWS Identity and Access Management roles in Confluent through the provider integration setup.
Reduced attack vector – The connector previously used IAM user access keys. Now, the Confluent Cloud Provider Integration uses an integration ID mapped to an IAM role, eliminating the risk of leaking access keys.
Reduced overhead – A best practice associated with access keys, also known as long-term credentials, is to rotate the keys every 90 days. This acts as a stop-gap by limiting the amount of time bad actors to act with compromised keys.
Enhanced security – IAM roles have a limited lifetime, so you do not have to update them or explicitly revoke them when they're no longer needed. After temporary security credentials expire, they cannot be reused. You can specify how long the credentials are valid, up to a maximum limit.
To explain how the integration works, the following walks through how to set up Confluent Cloud’s source connector for Amazon DynamoDB CDC to assume an IAM role.
Authorized access to Confluent Cloud with the OrganizationAdmin or EnvironmentAdmin role to set up provider integration. If you do not have the appropriate role, reach out to your OrganizationAdmin or EnvironmentAdmin.
cURL and jq installed to use the API request examples in this document.
A Confluent Cloud API key to authenticate with the Confluent Provider Integration API. For information about how to create a Confluent Cloud API key, see Manage API Keys.
You have an existing DynamoDB table (or multiple tables) in the us-east-1
region.
DynamoDB Streams is enabled on the DynamoDB table. You can follow this guide to do so if it is not already set.
This is one of the roles that Confluent Cloud’s source connector for Amazon DynamoDB CDC uses to retrieve data from your Amazon DynamoDB table. For ease, we’ve attached the AWS Managed policy AmazonDynamoDBFullAccess
; however, when implementing in your own environment, it is strongly recommended that the policy you attach to this role be properly scoped to the minimum amount of resources and actions it needs.
Navigate to the IAM Service within the AWS console.
Select Roles, and then click Create role.
In the Trusted entity type screen, select Custom trust policy. In the Custom trust policy editor, copy and paste the trust policy below. Notice that we don’t fully set the Principal
and ExternalID
values yet. For clarity, this is where we define what entities (a user, a role, or a service) can assume this role and, if appropriate, which entities to deny the ability to assume the role. An entity that assumes this role will be able to access and act according to what the attached IAM policies dictate. We will go back and fill these in properly after setting up the provider integration in Confluent Cloud via Confluent APIs.
Click Next to review the permissions, and then click Add permissions. Select the permission policy that you created or one of the AWS Managed policies for Amazon DynamoDB. For swift reference, here are the permissions required for the connector to function properly.
In the Name, review, and create screen, enter a Role name and a Description.
Click Create role to save your new IAM role.
Copy the ARN of the IAM role you just created for use in the provider integration setup in Confluent.
With the role created, we are ready to create a provider integration. This process will:
Register the role within Confluent Cloud.
Generate an integration ID which will be used in the connector configuration.
Generate the external ID used in the IAM role trust policy.
Note: Before proceeding, ensure you created a Confluent Cloud resource management key (not a Kafka API key). Second, ensure that you are base64 encoding your Confluent Cloud resource management keys. You can visit the documentation to learn how to do this. You will use this same base64 encoded string through the following commands:
Below is an example output after creating a provider integration. Make a note of the following as each is used in upcoming configurations:
iam_role_arn
– used in the IAM role trust policy for role chaining (i.e., the connector will assume this role first and then assume the role that you created earlier).
id
– this is the ID of the integration provider you just created.
external_id
– used in the IAM role trust policy.
Follow the steps below to update the trust policy with Confluent IAM role configurations in the AWS account. This allows Confluent to assume the role in your AWS account.
Open the AWS console at https://console.aws.amazon.com/iam/.
Navigate to Roles, and then open the IAM role you created in the "Create an IAM role" section.
In the Trust relationships tab, click Edit trust policy and update the following configurations:
Change Effect to Allow.
Under Principal, add iam_role_arn
from the Create IAM role mapping section. Essentially, this means “I will allow any entity that has this role specified in the Principal section to assume this connector role that you’ve created.” In this case, the entity that will be assuming the connector role is the Confluent Cloud connector.
Under Condition, add the external_id
from the Create IAM role mapping section.
Deploy a Confluent Cloud source connector for Amazon DynamoDB CDC using the following command. You will need to create Kafka cluster API keys (these are different from Confluent Cloud API keys). The Kafka cluster API keys as well as the provider integration ID will need to be inserted into the command before being run.
Once your connector has a Running
status, you will be able to view the data coming in from DynamoDB. You can do this by navigating to the Topics in your Confluent Cloud cluster. You will see a topic for every table you’ve chosen to import. By clicking into the topic, selecting the Messages tab, and selecting From beginning
in the dropdown you will be able to view the data that has been imported into your Confluent Cloud cluster.
Navigate to the DynamoDB connector and click the Settings
tab. Scroll down to the bottom of the page and click Delete Connector
.
Now navigate to the Topics
and delete the topics created by the connector. These will simply be the names of the tables you allowed access to the DynamoDB connector.
Last, delete the integration provider using the following command (be sure to replace with your own data):
Confluent Cloud’s Integration Provider allows for connectors to assume an IAM role to securely source from or sink to targets within your cloud environments. This eliminates the risk of credential leakage and reduces the overhead of managing access key rotation. Available across all major clouds, you can start using this feature by visiting the connector documentation or deploying directly from the AWS Marketplace.
62% of Confluent Cloud clusters run on AWS. Meanwhile, hundreds of thousands of customers are using DynamoDB. This blog explains how the connector helps customers integrate both platforms together.
Continuing our discussion of JVM microservices frameworks used with Apache Kafka, we introduce Micronaut. Let’s integrate a Micronaut microservice with Confluent Cloud—using Stream Governance—and test the Kafka integration with TestContainers.