Class CcApiContextQuery.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CcApiContextQuery>
- Enclosing interface:
CcApiContextQuery
CcApiContextQuery-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the value ofContextLookupRoleOptions.getAccount()assumeRoleAdditionalOptions(Map<String, ? extends Object> assumeRoleAdditionalOptions) Sets the value ofContextLookupRoleOptions.getAssumeRoleAdditionalOptions()build()Builds the configured instance.dummyValue(Object dummyValue) Sets the value ofCcApiContextQuery.getDummyValue()exactIdentifier(String exactIdentifier) Sets the value ofCcApiContextQuery.getExactIdentifier()expectedMatchCount(String expectedMatchCount) Sets the value ofCcApiContextQuery.getExpectedMatchCount()ignoreErrorOnMissingContext(Boolean ignoreErrorOnMissingContext) Sets the value ofCcApiContextQuery.getIgnoreErrorOnMissingContext()lookupRoleArn(String lookupRoleArn) Sets the value ofContextLookupRoleOptions.getLookupRoleArn()lookupRoleExternalId(String lookupRoleExternalId) Sets the value ofContextLookupRoleOptions.getLookupRoleExternalId()propertiesToReturn(List<String> propertiesToReturn) Sets the value ofCcApiContextQuery.getPropertiesToReturn()propertyMatch(Map<String, ? extends Object> propertyMatch) Sets the value ofCcApiContextQuery.getPropertyMatch()Sets the value ofContextLookupRoleOptions.getRegion()Sets the value ofCcApiContextQuery.getTypeName()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
propertiesToReturn
@Stability(Stable) public CcApiContextQuery.Builder propertiesToReturn(List<String> propertiesToReturn) Sets the value ofCcApiContextQuery.getPropertiesToReturn()- Parameters:
propertiesToReturn- This is a set of properties returned from CC API that we want to return from ContextQuery. This parameter is required. If any properties listed here are absent from the target resource, an error will be thrown.The returned object will always include the key
Identifierwith the CC-API returned fieldIdentifier.Notes on property completeness
CloudControl API's
ListResourcesmay return fewer properties thanGetResourcewould, depending on the resource implementation.The returned properties here are currently selected from the response object that CloudControl API returns to the CDK CLI.
However, if we find there is need to do so, we may decide to change this behavior in the future: we might change it to perform an additional
GetResourcecall for resources matched bypropertyMatch.- Returns:
this
-
typeName
Sets the value ofCcApiContextQuery.getTypeName()- Parameters:
typeName- The CloudFormation resource type. This parameter is required. See https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/supported-resources.html- Returns:
this
-
dummyValue
Sets the value ofCcApiContextQuery.getDummyValue()- Parameters:
dummyValue- The value to return if the resource was not found andignoreErrorOnMissingContextis true. If supplied,dummyValueshould be an array of objects.dummyValuedoes not have to have elements, and it may have objects with different properties than the properties inpropertiesToReturn, but it will be easiest for downstream code if thedummyValueconforms to the expected response shape.- Returns:
this
-
exactIdentifier
Sets the value ofCcApiContextQuery.getExactIdentifier()- Parameters:
exactIdentifier- Identifier of the resource to look up usingGetResource. Specifying exactIdentifier will return exactly one result, or throw an error unlessignoreErrorOnMissingContextis set.- Returns:
this
-
expectedMatchCount
Sets the value ofCcApiContextQuery.getExpectedMatchCount()- Parameters:
expectedMatchCount- Expected count of results ifpropertyMatchis specified. If the expected result count does not match the actual count, by default an error is produced and the result is not committed to cached context, and the user can correct the situation and try again without having to manually clear out the context key usingcdk context --removeIf the value of *
ignoreErrorOnMissingContextistrue, the value ofexpectedMatchCountisat-least-one | exactly-oneand the number of found resources is 0,dummyValueis returned and committed to context instead.- Returns:
this
-
ignoreErrorOnMissingContext
@Stability(Stable) public CcApiContextQuery.Builder ignoreErrorOnMissingContext(Boolean ignoreErrorOnMissingContext) Sets the value ofCcApiContextQuery.getIgnoreErrorOnMissingContext()- Parameters:
ignoreErrorOnMissingContext- Ignore an error and return thedummyValueinstead if the resource was not found.- In case of an
exactIdentifierlookup, return thedummyValueif the resource with that identifier was not found. - In case of a
propertyMatchlookup, return thedummyValueifexpectedMatchCountisat-least-one | exactly-oneand the number of resources found was 0.
if
ignoreErrorOnMissingContextis set,dummyValueshould be set and be an array.- In case of an
- Returns:
this
-
propertyMatch
@Stability(Stable) public CcApiContextQuery.Builder propertyMatch(Map<String, ? extends Object> propertyMatch) Sets the value ofCcApiContextQuery.getPropertyMatch()- Parameters:
propertyMatch- Returns any resources matching these properties, usingListResources. By default, specifying propertyMatch will successfully return 0 or more results. To throw an error if the number of results is unexpected (and prevent the query results from being committed to context), specifyexpectedMatchCount.Notes on property completeness
CloudControl API's
ListResourcesmay return fewer properties thanGetResourcewould, depending on the resource implementation.The resources that
propertyMatchmatches against will only ever be the properties returned by theListResourcescall.- Returns:
this
-
account
Sets the value ofContextLookupRoleOptions.getAccount()- Parameters:
account- Query account. This parameter is required.- Returns:
this
-
region
Sets the value ofContextLookupRoleOptions.getRegion()- Parameters:
region- Query region. This parameter is required.- Returns:
this
-
assumeRoleAdditionalOptions
@Stability(Stable) public CcApiContextQuery.Builder assumeRoleAdditionalOptions(Map<String, ? extends Object> assumeRoleAdditionalOptions) Sets the value ofContextLookupRoleOptions.getAssumeRoleAdditionalOptions()- Parameters:
assumeRoleAdditionalOptions- Additional options to pass to STS when assuming the lookup role.RoleArnshould not be used. Use the dedicatedlookupRoleArnproperty instead.ExternalIdshould not be used. Use the dedicatedlookupRoleExternalIdinstead.
- Returns:
this
-
lookupRoleArn
Sets the value ofContextLookupRoleOptions.getLookupRoleArn()- Parameters:
lookupRoleArn- The ARN of the role that should be used to look up the missing values.- Returns:
this
-
lookupRoleExternalId
@Stability(Stable) public CcApiContextQuery.Builder lookupRoleExternalId(String lookupRoleExternalId) Sets the value ofContextLookupRoleOptions.getLookupRoleExternalId()- Parameters:
lookupRoleExternalId- The ExternalId that needs to be supplied while assuming this role.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<CcApiContextQuery>- Returns:
- a new instance of
CcApiContextQuery - Throws:
NullPointerException- if any required attribute was not provided
-