Class: AWSCDK::CloudFront::DistributionGrants

Inherits:
Jsii::Object
  • Object
show all
Defined in:
cloud_front/distribution_grants.rb

Overview

Collection of grant methods for a IDistributionRef.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ DistributionGrants

Returns a new instance of DistributionGrants.

Raises:

  • (NoMethodError)


8
9
10
# File 'cloud_front/distribution_grants.rb', line 8

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

Class Method Details

.from_distribution(resource) ⇒ AWSCDK::CloudFront::DistributionGrants

Creates grants for DistributionGrants.

Parameters:

Returns:

  • (AWSCDK::CloudFront::DistributionGrants)


24
25
26
27
# File 'cloud_front/distribution_grants.rb', line 24

def self.from_distribution(resource)
  Jsii::Type.check_type(resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19jbG91ZGZyb250LklEaXN0cmlidXRpb25SZWYifQ==")), "resource")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.DistributionGrants", "fromDistribution", [resource])
end

.jsii_overridable_methodsObject



12
13
14
15
16
17
18
# File 'cloud_front/distribution_grants.rb', line 12

def self.jsii_overridable_methods
  {
    :resource => { kind: :property, name: "resource", is_optional: false },
    :actions => { kind: :method, name: "actions", is_optional: false },
    :create_invalidation => { kind: :method, name: "createInvalidation", is_optional: false },
  }
end

Instance Method Details

#actions(grantee, actions, options = nil) ⇒ AWSCDK::IAM::Grant

Grant the given identity custom permissions.

Parameters:

Returns:



40
41
42
43
44
45
46
# File 'cloud_front/distribution_grants.rb', line 40

def actions(grantee, actions, options = nil)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  Jsii::Type.check_type(actions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "actions")
  options = options.is_a?(Hash) ? ::AWSCDK::PermissionsOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5QZXJtaXNzaW9uc09wdGlvbnMifQ==")), "options") unless options.nil?
  jsii_call_method("actions", [grantee, actions, options])
end

#create_invalidation(grantee) ⇒ AWSCDK::IAM::Grant

Grant to create invalidations for this bucket to an IAM principal (Role/Group/User).

Parameters:

Returns:



52
53
54
55
# File 'cloud_front/distribution_grants.rb', line 52

def create_invalidation(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("createInvalidation", [grantee])
end

#resourceAWSCDK::Interfaces::AWSCloudfront::IDistributionRef



30
31
32
# File 'cloud_front/distribution_grants.rb', line 30

def resource()
  jsii_get_property("resource")
end