Class: AWSCDK::IAM::ServicePrincipalOpts
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::IAM::ServicePrincipalOpts
- Defined in:
- iam/service_principal_opts.rb
Overview
Options for a service principal.
Instance Attribute Summary collapse
-
#conditions ⇒ Hash{String => Object}?
readonly
Additional conditions to add to the Service Principal.
-
#region ⇒ String?
readonly
The region in which you want to reference the service.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(conditions: nil, region: nil) ⇒ ServicePrincipalOpts
constructor
A new instance of ServicePrincipalOpts.
- #to_jsii ⇒ Object
Constructor Details
#initialize(conditions: nil, region: nil) ⇒ ServicePrincipalOpts
Returns a new instance of ServicePrincipalOpts.
9 10 11 12 13 14 |
# File 'iam/service_principal_opts.rb', line 9 def initialize(conditions: nil, region: nil) @conditions = conditions Jsii::Type.check_type(@conditions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "conditions") unless @conditions.nil? @region = region Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil? end |
Instance Attribute Details
#conditions ⇒ Hash{String => Object}? (readonly)
Default: - No conditions
Additional conditions to add to the Service Principal.
20 21 22 |
# File 'iam/service_principal_opts.rb', line 20 def conditions @conditions end |
#region ⇒ String? (readonly)
Default: - the resolving Stack's region.
The region in which you want to reference the service.
This is only necessary for cross-region references to opt-in regions. In those cases, the region name needs to be included to reference the correct service principal. In all other cases, the global service principal name is sufficient.
This field behaves differently depending on whether the @aws-cdk/aws-iam:standardizedServicePrincipals
flag is set or not:
- If the flag is set, the input service principal is assumed to be of the form
SERVICE.amazonaws.com. That value will always be returned, unless the given region is an opt-in region and the service principal is rendered in a stack in a different region, in which caseSERVICE.REGION.amazonaws.comwill be rendered. Under this regime, there is no downside to always specifying the region property: it will be rendered only if necessary. - If the flag is not set, the service principal will resolve to a single principal
whose name comes from the
@aws-cdk/region-infopackage, using the region to override the stack region. If there is no entry for this service principal in the database,, the input service name is returned literally. This is legacy behavior and is not recommended.
42 43 44 |
# File 'iam/service_principal_opts.rb', line 42 def region @region end |
Class Method Details
.jsii_properties ⇒ Object
44 45 46 47 48 49 |
# File 'iam/service_principal_opts.rb', line 44 def self.jsii_properties { :conditions => "conditions", :region => "region", } end |
Instance Method Details
#to_jsii ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'iam/service_principal_opts.rb', line 51 def to_jsii result = {} result.merge!({ "conditions" => @conditions, "region" => @region, }) result.compact end |