Class: AWSCDK::AppSync::IAMResource

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

Overview

A class used to generate resource arns for AppSync.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ IAMResource

Returns a new instance of IAMResource.

Raises:

  • (NoMethodError)


8
9
10
# File 'app_sync/iam_resource.rb', line 8

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_appsync.IamResource does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.allAWSCDK::AppSync::IAMResource

Generate the resource names that accepts all types: *.

Returns:

  • (AWSCDK::AppSync::IAMResource)


21
22
23
# File 'app_sync/iam_resource.rb', line 21

def self.all()
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_appsync.IamResource", "all", [])
end

.custom(*arns) ⇒ AWSCDK::AppSync::IAMResource

Generate the resource names given custom arns.

Parameters:

  • arns (Array<String>)

    The custom arns that need to be permissioned.

Returns:

  • (AWSCDK::AppSync::IAMResource)


29
30
31
32
33
34
# File 'app_sync/iam_resource.rb', line 29

def self.custom(*arns)
  arns.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arns[#{index}]")
  end
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_appsync.IamResource", "custom", [*arns])
end

.jsii_overridable_methodsObject



12
13
14
15
16
# File 'app_sync/iam_resource.rb', line 12

def self.jsii_overridable_methods
  {
    :resource_arns => { kind: :method, name: "resourceArns", is_optional: false },
  }
end

.of_type(type, *fields) ⇒ AWSCDK::AppSync::IAMResource

Generate the resource names given a type and fields.

Parameters:

  • type (String)

    The type that needs to be allowed.

  • fields (Array<String>)

    The fields that need to be allowed, if empty grant permissions to ALL fields.

Returns:

  • (AWSCDK::AppSync::IAMResource)


41
42
43
44
45
46
47
# File 'app_sync/iam_resource.rb', line 41

def self.of_type(type, *fields)
  Jsii::Type.check_type(type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  fields.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "fields[#{index}]")
  end
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_appsync.IamResource", "ofType", [type, *fields])
end

Instance Method Details

#resource_arns(api) ⇒ Array<String>

Return the Resource ARN.

Parameters:

Returns:

  • (Array<String>)


53
54
55
56
# File 'app_sync/iam_resource.rb', line 53

def resource_arns(api)
  Jsii::Type.check_type(api, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5HcmFwaHFsQXBpQmFzZSJ9")), "api")
  jsii_call_method("resourceArns", [api])
end