Authentication and access - AWS SDKs and Tools

Authentication and access

You must establish how your code authenticates with AWS when you develop with AWS services. You can configure programmatic access to AWS resources in different ways, depending on the environment and the AWS access available to you.

Authentication options for code running locally (not in AWS)

  • IAM Identity Center authentication – As a security best practice, we recommend using AWS Organizations with IAM Identity Center to manage access across all your AWS accounts. You can create users in AWS IAM Identity Center, use Microsoft Active Directory, use a SAML 2.0 identity provider (IdP), or individually federate your IdP to AWS accounts. To check if your Region supports IAM Identity Center, see AWS IAM Identity Center endpoints and quotas in the Amazon Web Services General Reference.

  • IAM Roles Anywhere – You can use IAM Roles Anywhere to obtain temporary security credentials in IAM for workloads such as servers, containers, and applications that run outside of AWS. To use IAM Roles Anywhere, your workloads must use X.509 certificates.

  • Assume a role – You can assume an IAM role to temporarily access AWS resources that you might not have access to otherwise.

  • AWS access keys – Other options that might be less convenient or might increase the security risk to your AWS resources.

Authentication options for code running within an AWS environment

  • Using IAM roles for Amazon EC2 instances – Use IAM roles to securely run your application on an Amazon EC2 instance.

  • You can programmatically interact with AWS using IAM Identity Center in the following ways:

    • Use AWS CloudShell to run AWS CLI commands from the console.

    • Use AWS Cloud9 to start programming on AWS using an integrated development environment (IDE) with AWS resources.

    • To try cloud-based collaboration space for software development teams, consider using Amazon CodeCatalyst.

Authentication through a web-based identity provider - Mobile or client-based web applications

If you are creating mobile applications or client-based web applications that require access to AWS, build your app so that it requests temporary AWS security credentials dynamically by using web identity federation.

With web identity federation, you don't need to create custom sign-in code or manage your own user identities. Instead, app users can sign in using a well-known external identity provider (IdP), such as Login with Amazon, Facebook, Google, or any other OpenID Connect (OIDC)-compatible IdP. They can receive an authentication token, and then exchange that token for temporary security credentials in AWS that map to an IAM role with permissions to use the resources in your AWS account.

To learn how to configure this for your SDK or tool, see Federate with web identity or OpenID Connect.

For mobile applications, consider using Amazon Cognito. Amazon Cognito acts as an identity broker and does much of the federation work for you. For more information, see Using Amazon Cognito for mobile apps in the IAM User Guide.

More information about access management

The IAM User Guide has the following information about securely controlling access to AWS resources:

The Amazon Web Services General Reference has foundational basics on the following:

AWS Builder ID

Your AWS Builder ID complements any AWS accounts you might already own or want to create. While an AWS account acts as a container for AWS resources you create and provides a security boundary for those resources, your AWS Builder ID represents you as an individual. You can sign in with your AWS Builder ID to access developer tools and services such as Amazon CodeWhisperer and Amazon CodeCatalyst.