class BasicAuth
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Amplify.Alpha.BasicAuth |
Go | github.com/aws/aws-cdk-go/awscdkamplifyalpha/v2#BasicAuth |
Java | software.amazon.awscdk.services.amplify.alpha.BasicAuth |
Python | aws_cdk.aws_amplify_alpha.BasicAuth |
TypeScript (source) | @aws-cdk/aws-amplify-alpha ยป 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
Basic
Auth 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.
Credentials(username, password)
static frompublic 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.
GeneratedPassword(username, encryptionKey?)
static frompublic 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.