Class: AWSCDK::Greengrass::CfnFunctionDefinition::ResourceAccessPolicyProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
greengrass/cfn_function_definition.rb

Overview

A list of the resources in the group that the function can access, with the corresponding read-only or read-write permissions. The maximum is 10 resources.

This property applies only to Lambda functions that run in a Greengrass container.

In an CloudFormation template, ResourceAccessPolicy is a property of the Environment property type.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource_id:, permission: nil) ⇒ ResourceAccessPolicyProperty

Returns a new instance of ResourceAccessPolicyProperty.

Parameters:

  • resource_id (String)

    The ID of the resource.

  • permission (String, nil) (defaults to: nil)

    The read-only or read-write access that the Lambda function has to the resource.



986
987
988
989
990
991
# File 'greengrass/cfn_function_definition.rb', line 986

def initialize(resource_id:, permission: nil)
  @resource_id = resource_id
  Jsii::Type.check_type(@resource_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceId")
  @permission = permission
  Jsii::Type.check_type(@permission, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "permission") unless @permission.nil?
end

Instance Attribute Details

#permissionString? (readonly)

The read-only or read-write access that the Lambda function has to the resource.

Valid values are ro or rw .



1006
1007
1008
# File 'greengrass/cfn_function_definition.rb', line 1006

def permission
  @permission
end

#resource_idString (readonly)

The ID of the resource.

This ID is assigned to the resource when you create the resource definition.



999
1000
1001
# File 'greengrass/cfn_function_definition.rb', line 999

def resource_id
  @resource_id
end

Class Method Details

.jsii_propertiesObject



1008
1009
1010
1011
1012
1013
# File 'greengrass/cfn_function_definition.rb', line 1008

def self.jsii_properties
  {
    :resource_id => "resourceId",
    :permission => "permission",
  }
end

Instance Method Details

#to_jsiiObject



1015
1016
1017
1018
1019
1020
1021
1022
# File 'greengrass/cfn_function_definition.rb', line 1015

def to_jsii
  result = {}
  result.merge!({
    "resourceId" => @resource_id,
    "permission" => @permission,
  })
  result.compact
end