BasicAuth

class aws_cdk.aws_amplify.BasicAuth(*, encryption_key=None, password=None, username)

Bases: object

(experimental) Basic Auth configuration.

Stability

experimental

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_amplify as amplify
import aws_cdk.aws_kms as kms
import aws_cdk.core as cdk

# key is of type Key
# secret_value is of type SecretValue

basic_auth = amplify.BasicAuth(
    username="username",

    # the properties below are optional
    encryption_key=key,
    password=secret_value
)
Parameters
  • encryption_key (Optional[IKey]) – (experimental) The encryption key to use to encrypt the password when it’s generated in Secrets Manager. Default: - default master key

  • password (Optional[SecretValue]) – (experimental) The password. Default: - A Secrets Manager generated password

  • username (str) – (experimental) The username.

Stability

experimental

Methods

bind(scope, id)

(experimental) Binds this Basic Auth configuration to an App.

Parameters
Stability

experimental

Return type

BasicAuthConfig

Static Methods

classmethod from_credentials(username, password)

(experimental) Creates a Basic Auth configuration from a username and a password.

Parameters
  • username (str) – The username.

  • password (SecretValue) – The password.

Stability

experimental

Return type

BasicAuth

classmethod from_generated_password(username, encryption_key=None)

(experimental) Creates a Basic Auth configuration with a password generated in Secrets Manager.

Parameters
  • username (str) – The username.

  • encryption_key (Optional[IKey]) – The encryption key to use to encrypt the password in Secrets Manager.

Stability

experimental

Return type

BasicAuth