Add an AWS connector
Connect Harness to your AWS accounts and services.
Use a Harness AWS connector to authenticate and connect Harness to your AWS environment. The connector provides access to AWS services and resources for tasks such as obtaining artifacts, provisioning infrastructure, and deploying microservices and other workloads.
If you want to connect Harness to Elastic Kubernetes Service (Amazon EKS), you can use the platform-agnostic Kubernetes cluster connector or an AWS connector configured for EKS.
This topic explains how to set up an AWS connector.
What you will learn from this topic
How to configure roles and policies required by the AWS connector.
How to create an AWS connector, including credentials, backoff strategy, and connectivity mode settings.
How to troubleshoot common AWS connector errors.
How to define an AWS connector using a YAML example.
Before you begin
Harness account and project: You need access to a Harness account and project. You can also create the connector at the account or organization scope.
AWS account and IAM roles: You need an AWS account with the IAM roles and policies required for the AWS services you plan to use with Harness. For details, go to Configure roles and policies.
Harness Delegate (optional): If you plan to connect through a Harness Delegate instead of connecting directly, you need a delegate installed in your infrastructure. For more information, go to Delegate overview.
Configure roles and policies
The necessary IAM roles and policies needed by the AWS account used in the connector depend on which AWS service you are using with Harness and which operations you want Harness to perform in AWS. For an extensive description of roles and policies, go to the AWS connector settings reference.
AWS connectors can also inherit IAM roles from Harness Delegates running in AWS. If you want your connector to inherit from a delegate, make sure the delegate has the necessary roles.
The DescribeRegions action is required for all AWS connectors by default, regardless of what AWS service you are using for your target infrastructure. This requirement can be removed by enabling the feature flag CDS_AWS_DESCRIBE_REGIONS_OPTIONAL. For details, go to DescribeRegions - Optional.
If the IAM role associated with your AWS connector does not have the policies required by the AWS service you want to access, you can modify or change the role assigned to the AWS account or the Harness Delegate that your AWS connector is using. You may need to wait up to five minutes for the change to take effect.
Create an AWS connector
Perform the following steps to create the AWS connector.
The connector wizard guides you through six steps: Overview, Credentials, AWS Backoff Strategy, Select Connectivity Mode, Delegates Setup, and Connection Test.
Overview
Perform the following steps:
Go to Project Settings -> Connectors. You can also create connectors at the account or organization levels.
Select + New Connector -> Cloud Providers -> AWS - Cloud Provider.
Input a Name for the connector. Description and Tags are optional. Harness automatically creates an Id (entity identifier) for the connector based on the Name.

Select Continue to proceed to Credentials.
Credentials
Review the following information carefully to ensure you select the correct credentials configuration for your AWS connector.
Select one of the credential options:
AWS Access Key: Authenticate using an AWS Access Key and Secret Access Key stored as Harness secrets.
Assume IAM role on Delegate: Authenticate using the IAM role assigned to the Harness Delegate's underlying compute (for example, an EC2 instance profile or EKS node role), without storing separate AWS credentials in Harness.
Use IRSA: Authenticate using IAM Roles for Service Accounts (IRSA), for delegates running in an Amazon EKS cluster configured with an OIDC provider.
Use OIDC: Authenticate by having Harness act as an OIDC identity provider that AWS trusts to assume an IAM role, without storing long-lived AWS credentials.
Custom (Credential Broker), available when the feature flag
CDS_AWS_CUSTOM_CREDENTIAL_BROKER_AUTHENTICATIONis enabled on your account.

For details about each option, go to Credentials options.
If you select AWS Access Key, select an Authentication method:
Individual Secrets: Provide separate Access Key, Secret Key, and an optional Session Key secrets.
JSON Secret: Provide a single JSON-formatted secret and map its fields to the access key, secret key, and session token. This option requires the feature flag
PL_CONNECTOR_JSON_CREDENTIAL_MAPPING. For details, go to JSON secret mapping in the AWS connector settings reference.
If you select Use IRSA as the credential type, the Harness Kubernetes delegate in AWS EKS uses a specific IAM role for authenticated requests to resources. For setup instructions, go to Use IRSA in the AWS connector settings reference.
If you select Use OIDC as the credential type, you can use delegate selectors in OIDC tokens to enforce AWS IAM policies based on which delegates execute tasks. For details, go to Delegate selectors as session tags.
To use cross-account ARN, select Enable cross-account access (STS Role). This option is supported for the AWS Access Key, Assume IAM Role on Delegate, and IRSA credential types. Cross-account access is not supported with the OIDC credential type. For more information about cross-account access in AWS connectors, go to the AWS connector settings reference.
By default, Harness uses the
us-east-1region to test the credentials for AWS connectors. If you want to use a different region or an AWS GovCloud account, select it in the Test Region field. For more information about AWS GovCloud support, go to the AWS connector settings reference.Select Continue to proceed to AWS Backoff Strategy.
AWS Backoff Strategy
In some Harness CloudFormation and ECS deployments, AWS API calls can fail with ThrottlingException or Rate exceeded errors when requests exceed the maximum allowed rate for your AWS account and region. Use the AWS Backoff Strategy step to configure the Amazon SDK retry behavior for CloudFormation and ECS API calls and reduce the chance of throttling errors.

Select one of the following backoff strategies:
Fixed Delay: Uses a fixed delay before each retry attempt.
Equal Jitter: Uses equal jitter to compute the delay before each retry.
Full Jitter: Uses full jitter to compute the delay before each retry.
Select Continue to proceed to Select Connectivity Mode. For the full list of backoff strategy parameters and the throttled and non-throttled error codes each strategy applies to, go to AWS backoff strategy in the AWS connector settings reference.
Select Connectivity Mode
Harness uses AWS connectors during pipeline runs to authenticate and perform operations with AWS.
On the Connect to the provider page, select how you want Harness to connect to AWS:

Connect through Harness Platform: Use a direct, secure communication between Harness and AWS. All credentials are encrypted and stored in the Secret Manager configured in Harness. This connectivity mode is required for Harness Cloud build infrastructure.
Connect through a Harness Delegate: Harness communicates with AWS through a Harness Delegate you install in your environment, behind your corporate firewall. You must choose this option if you chose Use IRSA or Assume IAM role on Delegate for the connector credentials.
Select Continue to proceed to Delegates Setup.
Delegates Setup
If you selected Connect through a Harness Delegate, select either:
Use any available Delegate: Harness selects an available delegate at runtime. To learn how Harness selects delegates, go to Delegate overview.
Only use Delegates with all of the following tags: Use Tags to match one or more suitable delegates.
Go to Use delegate selectors to learn about delegate tags.
Select Install new Delegate if you need to install a delegate without exiting connector configuration.
Select Save and Continue to run the connection test.
Connection Test
Harness validates the AWS connector authentication and permissions and shows the delegate that executed the check.

Select View Delegate Tasks Logs to review the validation task logs. If validation succeeds, Harness displays Verification successful. Select Finish to complete the connector setup.
Troubleshooting
YAML examples
The following YAML examples show how to configure an AWS connector for each credential type.
AWS Access Key
The following YAML defines an AWS connector that uses the AWS Access Key credential type with the Individual Secrets authentication method, connects through a Harness Delegate, and runs the connection test on save.
Assume IAM Role on Delegate
The following YAML defines an AWS connector that uses the Assume IAM Role on Delegate credential type, selects a delegate by tag, and overrides the AWS backoff strategy with a fixed delay.
Use OIDC
The following YAML defines an AWS connector that uses the Use OIDC credential type to assume an IAM role through an OIDC identity provider.
Next steps
AWS connector settings reference: Review AWS connector settings, credentials options, and required permissions.
Delegate overview: Understand how Harness Delegates work and how they are selected.
Use delegate selectors: Target specific delegates using tags.
Install a Kubernetes delegate: Install a delegate in your Kubernetes cluster.
Private network connectivity options: Review connectivity options for Harness Cloud.
Last updated
Was this helpful?