class Aws::S3::ObjectLambdaARN

@api private

Public Class Methods

new(options) click to toggle source
Calls superclass method
# File lib/aws-sdk-s3/arn/object_lambda_arn.rb, line 7
def initialize(options)
  super(options)
  @type, @access_point_name, @extra = @resource.split(/[:,\/]/)
end

Public Instance Methods

host_url(region, fips = false, _dualstack = false, custom_endpoint = nil) click to toggle source
# File lib/aws-sdk-s3/arn/object_lambda_arn.rb, line 58
def host_url(region, fips = false, _dualstack = false, custom_endpoint = nil)
  pfx = "#{@access_point_name}-#{@account_id}"
  if custom_endpoint
    "#{pfx}.#{custom_endpoint}"
  else
    sfx = Aws::Partitions::EndpointProvider.dns_suffix_for(region)
    "#{pfx}.s3-object-lambda#{'-fips' if fips}.#{region}.#{sfx}"
  end
end
support_dualstack?() click to toggle source
# File lib/aws-sdk-s3/arn/object_lambda_arn.rb, line 12
def support_dualstack?
  false
end
support_fips?() click to toggle source
# File lib/aws-sdk-s3/arn/object_lambda_arn.rb, line 16
def support_fips?
  true
end
validate_arn!() click to toggle source
# File lib/aws-sdk-s3/arn/object_lambda_arn.rb, line 20
def validate_arn!
  unless @service == 's3-object-lambda'
    raise ArgumentError, 'Must provide a valid S3 Object Lambdas ARN.'
  end

  if @region.empty? || @account_id.empty?
    raise ArgumentError,
          'S3 Object Lambdas ARNs must contain both a region '\
          'and an account id.'
  end

  if @region.include?('-fips') || @region.include?('fips-')
    raise ArgumentError,
          'S3 Access Point ARNs cannot contain a FIPS region'
  end

  if @type != 'accesspoint'
    raise ArgumentError, 'Invalid ARN, resource format is not correct.'
  end

  if @access_point_name.nil? || @access_point_name.empty?
    raise ArgumentError, 'Missing ARN accesspoint name.'
  end

  if @extra
    raise ArgumentError,
          'ARN accesspoint resource must be a single value.'
  end

  unless Seahorse::Util.host_label?(
    "#{@access_point_name}-#{@account_id}"
  )
    raise ArgumentError,
          "#{@access_point_name}-#{@account_id} is not a valid "\
          'host label.'
  end
end