

This is the new *Amazon CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [Amazon CloudFormation User Guide](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::CredentialBroker::CredentialProvider

Specifies an Amazon IAM CredentialBroker credential provider. A provider obtains credentials from an external identity provider or authorization server on behalf of your workloads. Every provider belongs to a credential provider pool and inherits the settings that pool defines. Minimally, you must specify the following properties:
+ `CredentialProviderPoolIdentifier` – Specify the ID of the parent credential provider pool.
+ `Name` – Specify a name for the credential provider. The name must be unique within the parent pool.
+ `ProviderConfigurationInput` – Specify exactly one member. The member you set determines the provider type: `OauthConfiguration` creates an `OAUTH` provider (allowed grant types, vendor configuration, and client authentication), and `ApiKeyConfiguration` creates an `API_KEY` provider.

The provider configuration is write-only. Client secrets and API keys are never returned by CloudFormation reads; reads report the ARN of the Amazon Secrets Manager secret that holds them.

See the **Properties** section below for descriptions of both the required and optional properties.

## Syntax
<a name="aws-resource-credentialbroker-credentialprovider-syntax"></a>

To declare this entity in your Amazon CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-credentialbroker-credentialprovider-syntax.json"></a>

```json
{
  "Type" : "AWS::CredentialBroker::CredentialProvider",
  "Properties" : {
      "[CredentialProviderPoolIdentifier](#cfn-credentialbroker-credentialprovider-credentialproviderpoolidentifier)" : {{String}},
      "[Name](#cfn-credentialbroker-credentialprovider-name)" : {{String}},
      "[ProviderConfigurationInput](#cfn-credentialbroker-credentialprovider-providerconfigurationinput)" : {{CredentialProviderConfigurationInput}},
      "[Tags](#cfn-credentialbroker-credentialprovider-tags)" : {{[ Tag, ... ]}}
    }
}
```

### YAML
<a name="aws-resource-credentialbroker-credentialprovider-syntax.yaml"></a>

```yaml
Type: AWS::CredentialBroker::CredentialProvider
Properties:
  [CredentialProviderPoolIdentifier](#cfn-credentialbroker-credentialprovider-credentialproviderpoolidentifier): {{String}}
  [Name](#cfn-credentialbroker-credentialprovider-name): {{String}}
  [ProviderConfigurationInput](#cfn-credentialbroker-credentialprovider-providerconfigurationinput): {{
    CredentialProviderConfigurationInput}}
  [Tags](#cfn-credentialbroker-credentialprovider-tags): {{
    - Tag}}
```

## Properties
<a name="aws-resource-credentialbroker-credentialprovider-properties"></a>

`CredentialProviderPoolIdentifier`  <a name="cfn-credentialbroker-credentialprovider-credentialproviderpoolidentifier"></a>
The service-generated ID of the credential provider pool to create the credential provider in. Use the `CredentialProviderPoolIdentifier` attribute of an `AWS::CredentialBroker::CredentialProviderPool` resource, for example with `Fn::GetAtt`.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^[a-z0-9]{1,64}$`  
*Minimum*: `1`  
*Maximum*: `64`  
*Update requires*: [Replacement](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Name`  <a name="cfn-credentialbroker-credentialprovider-name"></a>
The name for the credential provider. Must be unique among the providers that currently exist in the same pool. To rename the provider, change this value in your template; the provider is updated in place.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^[a-zA-Z0-9_.-]{1,128}$`  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ProviderConfigurationInput`  <a name="cfn-credentialbroker-credentialprovider-providerconfigurationinput"></a>
Write-only, type-specific provider configuration. Set exactly one member. The current schema supports `OauthConfiguration`.  
*Required*: Yes  
*Type*: [CredentialProviderConfigurationInput](aws-properties-credentialbroker-credentialprovider-credentialproviderconfigurationinput.md)  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-credentialbroker-credentialprovider-tags"></a>
Metadata that you can assign to the credential provider as key-value pairs. You can specify up to 50 tags. For more information, see the following resources:  
+  [Tag naming limits and requirements](https://docs.amazonaws.cn/tag-editor/latest/userguide/tagging.html#tag-conventions) 
+  [Tagging best practices](https://docs.amazonaws.cn/tag-editor/latest/userguide/tagging.html#tag-best-practices) 
*Required*: No  
*Type*: Array of [Tag](aws-properties-credentialbroker-credentialprovider-tag.md)  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-credentialbroker-credentialprovider-return-values"></a>

### Ref
<a name="aws-resource-credentialbroker-credentialprovider-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the Amazon Resource Name (ARN) of the provider, which is the resource's primary identifier.

For more information about using the `Ref` function, see [`Ref`](https://docs.amazonaws.cn/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-credentialbroker-credentialprovider-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [`Fn::GetAtt`](https://docs.amazonaws.cn/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-credentialbroker-credentialprovider-return-values-fn--getatt-fn--getatt"></a>

`CreatedAt`  <a name="CreatedAt-fn::getatt"></a>
The ISO 8601 timestamp of when the credential provider was created.

`CredentialProviderArn`  <a name="CredentialProviderArn-fn::getatt"></a>
The Amazon Resource Name (ARN) of the provider. This is the primary identifier and the value returned by `Ref`.

`CredentialProviderIdentifier`  <a name="CredentialProviderIdentifier-fn::getatt"></a>
The service-generated provider identifier. This is an additional identifier accepted by operations that accept a provider identifier; it is not the value returned by `Ref`.

`ProviderType`  <a name="ProviderType-fn::getatt"></a>
The provider type. For the current resource schema, the value is `OAUTH`.

`Status`  <a name="Status-fn::getatt"></a>
The lifecycle status of the provider. Create, update, and delete operations are asynchronous. Possible values are `CREATING`, `UPDATING`, `DELETING`, `READY`, and `FAILED`.

`UpdatedAt`  <a name="UpdatedAt-fn::getatt"></a>
The ISO 8601 timestamp of when the credential provider was last updated.

## Examples
<a name="aws-resource-credentialbroker-credentialprovider--examples"></a>

The following example creates an OAuth credential provider with a custom authorization server. Replace the example client and discovery values with values from your authorization server.

### Create an OAuth credential provider
<a name="aws-resource-credentialbroker-credentialprovider--examples--Create_an_OAuth_credential_provider"></a>

#### YAML
<a name="aws-resource-credentialbroker-credentialprovider--examples--Create_an_OAuth_credential_provider--yaml"></a>

```yaml
Resources:
  CredentialProviderPool:
    Type: AWS::CredentialBroker::CredentialProviderPool
    Properties:
      Name: example-pool
  CredentialProvider:
    Type: AWS::CredentialBroker::CredentialProvider
    Properties:
      CredentialProviderPoolIdentifier: !Ref CredentialProviderPool
      Name: example-provider
      ProviderConfigurationInput:
        OauthConfiguration:
          AllowedGrantTypes:
            - CLIENT_CREDENTIALS
          VendorConfigurationInput:
            CustomConfiguration:
              ClientAuthenticationConfiguration:
                ClientAuthenticationMethod: NONE
                ClientId: example-client-id
              OauthDiscovery:
                DiscoveryUrl: https://idp.example.com/.well-known/openid-configuration
```