

# How to Specify the Amazon Security Credentials for Your Application
<a name="deployment-beanstalk-specify-credentials"></a>

The Amazon account you specify in the **Publish to Elastic Beanstalk** wizard is the Amazon account the wizard will use for deployment to Elastic Beanstalk.

Although not recommended, you may also need to specify Amazon account credentials that your application will use to access Amazon services after it has been deployed. The preferred approach is to specify an IAM role. In the **Publish to Elastic Beanstalk** wizard, you do this through the **Identity and Access Management Role** drop-down list on the **Amazon Options** page. In the legacy **Publish to Amazon Web Services** wizard, you do this through the **IAM Role** drop-down list on the **Amazon Options** page.

If you must use Amazon account credentials instead of an IAM role, you can specify the Amazon account credentials for your application in one of the following ways:
+ Reference a profile corresponding to the Amazon account credentials in the `appSettings` element of the project's `Web.config` file. (To create a profile, see [Configuring Amazon Credentials](https://docs.amazonaws.cn/sdk-for-net/latest/developer-guide/net-dg-config-creds.html).) The following example specifies credentials whose profile name is `myProfile`.

  ```
  <appSettings>
    <!-- Amazon CREDENTIALS -->
    <add key="AWSProfileName" value="myProfile"/>
  </appSettings>
  ```
+ If you're using the **Publish to Elastic Beanstalk** wizard, on the **Application Options** page, in the **Key** row of the **Key** and **Value** area, choose **AmazonAccessKey**. In the **Value** row, type the access key. Repeat these steps for **AmazonSecretKey**.
+ If you're using the legacy **Publish to Amazon Web Services** wizard, on the **Application Options** page, in the **Application Credentials** area, choose **Use these credentials**, and then type the access key and secret access key into the **Access Key** and **Secret Key** boxes.