Class: AWSCDK::AppSync::AppSyncAuthProvider

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
app_sync/app_sync_auth_provider.rb

Overview

Auth provider settings for AppSync Event APIs.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authorization_type:, api_key_config: nil, cognito_config: nil, lambda_authorizer_config: nil, open_id_connect_config: nil) ⇒ AppSyncAuthProvider

Returns a new instance of AppSyncAuthProvider.

Parameters:



14
15
16
17
18
19
20
21
22
23
24
25
# File 'app_sync/app_sync_auth_provider.rb', line 14

def initialize(authorization_type:, api_key_config: nil, cognito_config: nil, lambda_authorizer_config: nil, open_id_connect_config: nil)
  @authorization_type = authorization_type
  Jsii::Type.check_type(@authorization_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jQXV0aG9yaXphdGlvblR5cGUifQ==")), "authorizationType")
  @api_key_config = api_key_config.is_a?(Hash) ? ::AWSCDK::AppSync::AppSyncAPIKeyConfig.new(**api_key_config.transform_keys(&:to_sym)) : api_key_config
  Jsii::Type.check_type(@api_key_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jQXBpS2V5Q29uZmlnIn0=")), "apiKeyConfig") unless @api_key_config.nil?
  @cognito_config = cognito_config.is_a?(Hash) ? ::AWSCDK::AppSync::AppSyncCognitoConfig.new(**cognito_config.transform_keys(&:to_sym)) : cognito_config
  Jsii::Type.check_type(@cognito_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jQ29nbml0b0NvbmZpZyJ9")), "cognitoConfig") unless @cognito_config.nil?
  @lambda_authorizer_config = lambda_authorizer_config.is_a?(Hash) ? ::AWSCDK::AppSync::AppSyncLambdaAuthorizerConfig.new(**lambda_authorizer_config.transform_keys(&:to_sym)) : lambda_authorizer_config
  Jsii::Type.check_type(@lambda_authorizer_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jTGFtYmRhQXV0aG9yaXplckNvbmZpZyJ9")), "lambdaAuthorizerConfig") unless @lambda_authorizer_config.nil?
  @open_id_connect_config = open_id_connect_config.is_a?(Hash) ? ::AWSCDK::AppSync::AppSyncOpenIdConnectConfig.new(**open_id_connect_config.transform_keys(&:to_sym)) : open_id_connect_config
  Jsii::Type.check_type(@open_id_connect_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jT3BlbklkQ29ubmVjdENvbmZpZyJ9")), "openIdConnectConfig") unless @open_id_connect_config.nil?
end

Instance Attribute Details

#api_key_configAWSCDK::AppSync::AppSyncAPIKeyConfig? (readonly)

Note:

Default: - name: 'DefaultAPIKey'

If authorizationType is AuthorizationType.API_KEY, this option can be configured.



36
37
38
# File 'app_sync/app_sync_auth_provider.rb', line 36

def api_key_config
  @api_key_config
end

#authorization_typeAWSCDK::AppSync::AppSyncAuthorizationType (readonly)

Note:

Default: - AuthorizationType.API_KEY

One of possible authorization types AppSync supports.



31
32
33
# File 'app_sync/app_sync_auth_provider.rb', line 31

def authorization_type
  @authorization_type
end

#cognito_configAWSCDK::AppSync::AppSyncCognitoConfig? (readonly)

Note:

Default: - none

If authorizationType is AuthorizationType.USER_POOL, this option is required.



41
42
43
# File 'app_sync/app_sync_auth_provider.rb', line 41

def cognito_config
  @cognito_config
end

#lambda_authorizer_configAWSCDK::AppSync::AppSyncLambdaAuthorizerConfig? (readonly)

Note:

Default: - none

If authorizationType is AuthorizationType.LAMBDA, this option is required.



46
47
48
# File 'app_sync/app_sync_auth_provider.rb', line 46

def lambda_authorizer_config
  @lambda_authorizer_config
end

#open_id_connect_configAWSCDK::AppSync::AppSyncOpenIdConnectConfig? (readonly)

Note:

Default: - none

If authorizationType is AuthorizationType.OIDC, this option is required.



51
52
53
# File 'app_sync/app_sync_auth_provider.rb', line 51

def open_id_connect_config
  @open_id_connect_config
end

Class Method Details

.jsii_propertiesObject



53
54
55
56
57
58
59
60
61
# File 'app_sync/app_sync_auth_provider.rb', line 53

def self.jsii_properties
  {
    :authorization_type => "authorizationType",
    :api_key_config => "apiKeyConfig",
    :cognito_config => "cognitoConfig",
    :lambda_authorizer_config => "lambdaAuthorizerConfig",
    :open_id_connect_config => "openIdConnectConfig",
  }
end

Instance Method Details

#to_jsiiObject



63
64
65
66
67
68
69
70
71
72
73
# File 'app_sync/app_sync_auth_provider.rb', line 63

def to_jsii
  result = {}
  result.merge!({
    "authorizationType" => @authorization_type,
    "apiKeyConfig" => @api_key_config,
    "cognitoConfig" => @cognito_config,
    "lambdaAuthorizerConfig" => @lambda_authorizer_config,
    "openIdConnectConfig" => @open_id_connect_config,
  })
  result.compact
end