Class: AWSCDK::GameLift::CfnScriptProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
game_lift/cfn_script_props.rb

Overview

Properties for defining a CfnScript.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(storage_location:, name: nil, node_js_version: nil, tags: nil, version: nil) ⇒ CfnScriptProps

Returns a new instance of CfnScriptProps.

Parameters:

  • storage_location (AWSCDK::IResolvable, AWSCDK::GameLift::CfnScript::S3LocationProperty)

    The location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored.

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

    A descriptive label that is associated with a script.

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

    The Node.js version used for execution of the Realtime script.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    A list of labels to assign to the new script resource.

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

    The version that is associated with a build or script.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'game_lift/cfn_script_props.rb', line 14

def initialize(storage_location:, name: nil, node_js_version: nil, tags: nil, version: nil)
  @storage_location = storage_location.is_a?(Hash) ? ::AWSCDK::GameLift::CfnScript::S3LocationProperty.new(**storage_location.transform_keys(&:to_sym)) : storage_location
  Jsii::Type.check_type(@storage_location, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19nYW1lbGlmdC5DZm5TY3JpcHQuUzNMb2NhdGlvblByb3BlcnR5In1dfX0=")), "storageLocation")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @node_js_version = node_js_version
  Jsii::Type.check_type(@node_js_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nodeJsVersion") unless @node_js_version.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @version = version
  Jsii::Type.check_type(@version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "version") unless @version.nil?
end

Instance Attribute Details

#nameString? (readonly)

A descriptive label that is associated with a script.

Script names do not need to be unique.



40
41
42
# File 'game_lift/cfn_script_props.rb', line 40

def name
  @name
end

#node_js_versionString? (readonly)

The Node.js version used for execution of the Realtime script.



45
46
47
# File 'game_lift/cfn_script_props.rb', line 45

def node_js_version
  @node_js_version
end

#storage_locationAWSCDK::IResolvable, AWSCDK::GameLift::CfnScript::S3LocationProperty (readonly)

The location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored.

The storage location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon GameLift Servers to access the Amazon S3 storage location. The S3 bucket must be in the same Region where you want to create a new script. By default, Amazon GameLift Servers uploads the latest version of the zip file; if you have S3 object versioning turned on, you can use the ObjectVersion parameter to specify an earlier version.



33
34
35
# File 'game_lift/cfn_script_props.rb', line 33

def storage_location
  @storage_location
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

A list of labels to assign to the new script resource.

Tags are developer-defined key-value pairs. Tagging AWS resources are useful for resource management, access management and cost allocation. For more information, see Tagging AWS Resources in the AWS General Reference . Once the resource is created, you can use TagResource, UntagResource, and ListTagsForResource to add, remove, and view tags. The maximum tag limit may be lower than stated. See the AWS General Reference for actual tagging limits.



52
53
54
# File 'game_lift/cfn_script_props.rb', line 52

def tags
  @tags
end

#versionString? (readonly)

The version that is associated with a build or script.

Version strings do not need to be unique.



59
60
61
# File 'game_lift/cfn_script_props.rb', line 59

def version
  @version
end

Class Method Details

.jsii_propertiesObject



61
62
63
64
65
66
67
68
69
# File 'game_lift/cfn_script_props.rb', line 61

def self.jsii_properties
  {
    :storage_location => "storageLocation",
    :name => "name",
    :node_js_version => "nodeJsVersion",
    :tags => "tags",
    :version => "version",
  }
end

Instance Method Details

#to_jsiiObject



71
72
73
74
75
76
77
78
79
80
81
# File 'game_lift/cfn_script_props.rb', line 71

def to_jsii
  result = {}
  result.merge!({
    "storageLocation" => @storage_location,
    "name" => @name,
    "nodeJsVersion" => @node_js_version,
    "tags" => @tags,
    "version" => @version,
  })
  result.compact
end