apps
Creates, updates, deletes or gets an app resource or lists apps in a region
Overview
| Name | apps |
| Type | Resource |
| Description | Resource Type Definition for AWS::ResilienceHub::App. |
| Id | awscc.resiliencehub.apps |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the app. |
description | string | App description. |
app_arn | string | Amazon Resource Name (ARN) of the App. |
resiliency_policy_arn | string | Amazon Resource Name (ARN) of the Resiliency Policy. |
tags | object | |
app_template_body | string | A string containing full ResilienceHub app template body. |
resource_mappings | array | An array of ResourceMapping objects. |
app_assessment_schedule | string | Assessment execution schedule. |
permission_model | object | Defines the roles and credentials that AWS Resilience Hub would use while creating the application, importing its resources, and running an assessment. |
event_subscriptions | array | The list of events you would like to subscribe and get notification for. |
drift_status | string | Indicates if compliance drifts (deviations) were detected while running an assessment for your application. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
app_arn | string | Amazon Resource Name (ARN) of the App. |
region | string | AWS region. |
For more information, see AWS::ResilienceHub::App.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | apps | INSERT | Name, AppTemplateBody, ResourceMappings, region |
delete_resource | apps | DELETE | Identifier, region |
update_resource | apps | UPDATE | Identifier, PatchDocument, region |
list_resources | apps_list_only | SELECT | region |
get_resource | apps | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual app.
SELECT
region,
name,
description,
app_arn,
resiliency_policy_arn,
tags,
app_template_body,
resource_mappings,
app_assessment_schedule,
permission_model,
event_subscriptions,
drift_status
FROM awscc.resiliencehub.apps
WHERE
region = '{{ region }}' AND
Identifier = '{{ app_arn }}';
Lists all apps in a region.
SELECT
region,
app_arn
FROM awscc.resiliencehub.apps_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new app resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.resiliencehub.apps (
Name,
AppTemplateBody,
ResourceMappings,
region
)
SELECT
'{{ name }}',
'{{ app_template_body }}',
'{{ resource_mappings }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.resiliencehub.apps (
Name,
Description,
ResiliencyPolicyArn,
Tags,
AppTemplateBody,
ResourceMappings,
AppAssessmentSchedule,
PermissionModel,
EventSubscriptions,
region
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ resiliency_policy_arn }}',
'{{ tags }}',
'{{ app_template_body }}',
'{{ resource_mappings }}',
'{{ app_assessment_schedule }}',
'{{ permission_model }}',
'{{ event_subscriptions }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: app
props:
- name: name
value: '{{ name }}'
- name: description
value: '{{ description }}'
- name: resiliency_policy_arn
value: '{{ resiliency_policy_arn }}'
- name: tags
value: {}
- name: app_template_body
value: '{{ app_template_body }}'
- name: resource_mappings
value:
- logical_stack_name: '{{ logical_stack_name }}'
mapping_type: '{{ mapping_type }}'
resource_name: '{{ resource_name }}'
terraform_source_name: '{{ terraform_source_name }}'
eks_source_name: '{{ eks_source_name }}'
physical_resource_id:
aws_account_id: '{{ aws_account_id }}'
aws_region: '{{ aws_region }}'
identifier: '{{ identifier }}'
type: '{{ type }}'
- name: app_assessment_schedule
value: '{{ app_assessment_schedule }}'
- name: permission_model
value:
type: '{{ type }}'
invoker_role_name: '{{ invoker_role_name }}'
cross_account_role_arns:
- '{{ cross_account_role_arns[0] }}'
- name: event_subscriptions
value:
- name: '{{ name }}'
event_type: '{{ event_type }}'
sns_topic_arn: '{{ sns_topic_arn }}'
UPDATE example
Use the following StackQL query and manifest file to update a app resource, using stack-deploy.
/*+ update */
UPDATE awscc.resiliencehub.apps
SET PatchDocument = string('{{ {
"Description": description,
"ResiliencyPolicyArn": resiliency_policy_arn,
"Tags": tags,
"AppTemplateBody": app_template_body,
"ResourceMappings": resource_mappings,
"AppAssessmentSchedule": app_assessment_schedule,
"PermissionModel": permission_model,
"EventSubscriptions": event_subscriptions
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ app_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.resiliencehub.apps
WHERE
Identifier = '{{ app_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the apps resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
cloudformation:DescribeStacks,
cloudformation:ListStackResources,
s3:GetBucketLocation,
s3:GetObject,
s3:ListAllMyBuckets,
autoscaling:DescribeAutoScalingGroups,
apigateway:GET,
ec2:Describe*,
ecs:DescribeServices,
eks:DescribeCluster,
elasticfilesystem:DescribeFileSystems,
elasticloadbalancing:DescribeLoadBalancers,
lambda:GetFunction*,
rds:Describe*,
dynamodb:Describe*,
sqs:GetQueueAttributes,
sns:GetTopicAttributes,
route53:List*,
iam:PassRole,
resiliencehub:CreateApp,
resiliencehub:DescribeApp,
resiliencehub:DescribeAppVersionTemplate,
resiliencehub:PutDraftAppVersionTemplate,
resiliencehub:AddDraftAppVersionResourceMappings,
resiliencehub:ListAppVersionResourceMappings,
resiliencehub:ListAppVersions,
resiliencehub:PublishAppVersion,
resiliencehub:ListTagsForResource,
resiliencehub:TagResource,
resiliencehub:UntagResource
resiliencehub:DescribeApp,
resiliencehub:DescribeAppVersionTemplate,
resiliencehub:ListAppVersionResourceMappings,
resiliencehub:ListTagsForResource,
resiliencehub:ListAppVersions
cloudformation:DescribeStacks,
cloudformation:ListStackResources,
s3:GetBucketLocation,
s3:GetObject,
s3:ListAllMyBuckets,
autoscaling:DescribeAutoScalingGroups,
apigateway:GET,
ec2:Describe*,
ecs:DescribeServices,
eks:DescribeCluster,
elasticfilesystem:DescribeFileSystems,
elasticloadbalancing:DescribeLoadBalancers,
lambda:GetFunction*,
rds:Describe*,
dynamodb:Describe*,
sqs:GetQueueAttributes,
sns:GetTopicAttributes,
route53:List*,
iam:PassRole,
resiliencehub:UpdateApp,
resiliencehub:DescribeApp,
resiliencehub:DescribeAppVersionTemplate,
resiliencehub:PutDraftAppVersionTemplate,
resiliencehub:AddDraftAppVersionResourceMappings,
resiliencehub:RemoveDraftAppVersionResourceMappings,
resiliencehub:ListAppVersionResourceMappings,
resiliencehub:ListAppVersions,
resiliencehub:PublishAppVersion,
resiliencehub:ListTagsForResource,
resiliencehub:TagResource,
resiliencehub:UntagResource
resiliencehub:DeleteApp,
resiliencehub:UntagResource,
resiliencehub:ListApps
resiliencehub:ListApps