Class: Aws::S3Control::OutpostBucketARN Private

Inherits:
ARN
  • Object
show all
Defined in:
lib/aws-sdk-s3control/arn/outpost_bucket_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 Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ OutpostBucketARN

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 OutpostBucketARN.



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

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

Instance Attribute Details

#bucket_nameObject (readonly)

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.



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

def bucket_name
  @bucket_name
end

#outpost_idObject (readonly)

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.



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

def outpost_id
  @outpost_id
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 Bucket ARNs currently do not support dualstack



72
73
74
75
76
77
78
# File 'lib/aws-sdk-s3control/arn/outpost_bucket_arn.rb', line 72

def host_url(region, fips = false, _dualstack = false, custom_endpoint = nil)
  if custom_endpoint
    custom_endpoint
  else
    "s3-outposts#{'-fips' if fips}.#{region}.amazonaws.com"
  end
end

#input_memberObject

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.

After expanding this ARN, this value will be used to repopulate input so that URIs do not contain ARNs



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

def input_member
  bucket_name
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)


21
22
23
# File 'lib/aws-sdk-s3control/arn/outpost_bucket_arn.rb', line 21

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)


25
26
27
# File 'lib/aws-sdk-s3control/arn/outpost_bucket_arn.rb', line 25

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.



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
62
63
64
65
66
67
68
69
# File 'lib/aws-sdk-s3control/arn/outpost_bucket_arn.rb', line 29

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

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

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

  if @type != 'outpost' && @subtype != 'bucket'
    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 @bucket_name.nil? || @bucket_name.empty?
    raise ArgumentError, 'Missing ARN bucket name.'
  end

  if @extra
    raise ArgumentError,
          'ARN Outpost bucket must be a single value.'
  end

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

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