Class: Aws::S3::OutpostAccessPointARN Private

Inherits:
ARN
  • Object
show all
Defined in:
lib/aws-sdk-s3/arn/outpost_access_point_arn.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ OutpostAccessPointARN

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of OutpostAccessPointARN.


7
8
9
10
11
# File 'lib/aws-sdk-s3/arn/outpost_access_point_arn.rb', line 7

def initialize(options)
  super(options)
  @type, @outpost_id, @subtype, @access_point_name, @extra =
    @resource.split(/[:,\/]/)
end

Instance Method Details

#host_url(region, _fips = false, _dualstack = false, custom_endpoint = nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Outpost ARNs currently do not support dualstack


64
65
66
67
68
69
70
71
# File 'lib/aws-sdk-s3/arn/outpost_access_point_arn.rb', line 64

def host_url(region, _fips = false, _dualstack = false, custom_endpoint = nil)
  pfx = "#{@access_point_name}-#{@account_id}.#{@outpost_id}"
  if custom_endpoint
    "#{pfx}.#{custom_endpoint}"
  else
    "#{pfx}.s3-outposts.#{region}.amazonaws.com"
  end
end

#support_dualstack?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

13
14
15
# File 'lib/aws-sdk-s3/arn/outpost_access_point_arn.rb', line 13

def support_dualstack?
  false
end

#support_fips?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

17
18
19
# File 'lib/aws-sdk-s3/arn/outpost_access_point_arn.rb', line 17

def support_fips?
  false
end

#validate_arn!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/aws-sdk-s3/arn/outpost_access_point_arn.rb', line 21

def validate_arn!
  unless @service == 's3-outposts'
    raise ArgumentError, 'Must provide a valid S3 Outpost Access '\
                         'Point ARN.'
  end

  if @region.empty? || @account_id.empty?
    raise ArgumentError,
          'S3 Outpost Access Point ARNs must contain both a region '\
          'and an account ID.'
  end

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

  if @outpost_id.nil? || @outpost_id.empty?
    raise ArgumentError, 'Missing ARN Outpost ID.'
  end

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

  if @extra
    raise ArgumentError,
          'ARN Access Point 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

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