class BasicAuth
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Amplify.BasicAuth |
Java | software.amazon.awscdk.services.amplify.BasicAuth |
Python | aws_cdk.aws_amplify.BasicAuth |
TypeScript (source) | @aws-cdk/aws-amplify » BasicAuth |
Basic Auth configuration.
Example
const amplifyApp = new amplify.App(this, 'MyApp', {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: '<user>',
repository: '<repo>',
oauthToken: SecretValue.secretsManager('my-github-token'),
}),
basicAuth: amplify.BasicAuth.fromGeneratedPassword('username'),
});
Initializer
new BasicAuth(props: BasicAuthProps)
Parameters
- props
BasicAuth Props
Methods
| Name | Description |
|---|---|
| bind(scope, id) | Binds this Basic Auth configuration to an App. |
| static from | Creates a Basic Auth configuration from a username and a password. |
| static from | Creates a Basic Auth configuration with a password generated in Secrets Manager. |
bind(scope, id)
public bind(scope: Construct, id: string): BasicAuthConfig
Parameters
- scope
Construct - id
string
Returns
Binds this Basic Auth configuration to an App.
static fromCredentials(username, password)
public static fromCredentials(username: string, password: SecretValue): BasicAuth
Parameters
- username
string— The username. - password
Secret— The password.Value
Returns
Creates a Basic Auth configuration from a username and a password.
static fromGeneratedPassword(username, encryptionKey?)
public static fromGeneratedPassword(username: string, encryptionKey?: IKey): BasicAuth
Parameters
- username
string— The username. - encryptionKey
IKey— The encryption key to use to encrypt the password in Secrets Manager.
Returns
Creates a Basic Auth configuration with a password generated in Secrets Manager.

.NET
Java
Python
TypeScript (