platform_applications
Creates, updates, deletes, gets or lists a platform_applications resource.
Overview
| Name | platform_applications |
| Type | Resource |
| Id | aws.sns.platform_applications |
Fields
The following fields are returned by SELECT queries:
- list_platform_applications
| Name | Datatype | Description |
|---|---|---|
attributes | string | Attributes for platform application object. |
platform_application_arn | string | PlatformApplicationArn for platform application object. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_platform_applications | select | region | NextToken | Lists the platform application objects for the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging). The results for ListPlatformApplications are paginated and return a limited list of applications, up to 100. If additional records are available after the first page results, then a NextToken string will be returned. To receive the next page, you call ListPlatformApplications using the NextToken string received from the previous call. When there are no more records to return, NextToken will be null. For more information, see Using Amazon SNS Mobile Push Notifications. This action is throttled at 15 transactions per second (TPS). |
create_platform_application | insert | Name, Platform, region | Attributes | Creates a platform application object for one of the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging), to which devices and mobile apps may register. You must specify PlatformPrincipal and PlatformCredential attributes when using the CreatePlatformApplication action. PlatformPrincipal and PlatformCredential are received from the notification service. For ADM, PlatformPrincipal is client id and PlatformCredential is client secret. For APNS and APNS_SANDBOX using certificate credentials, PlatformPrincipal is SSL certificate and PlatformCredential is private key. For APNS and APNS_SANDBOX using token credentials, PlatformPrincipal is signing key ID and PlatformCredential is signing key. For Baidu, PlatformPrincipal is API key and PlatformCredential is secret key. For GCM (Firebase Cloud Messaging) using key credentials, there is no PlatformPrincipal. The PlatformCredential is API key. For GCM (Firebase Cloud Messaging) using token credentials, there is no PlatformPrincipal. The PlatformCredential is a JSON formatted private key file. When using the Amazon Web Services CLI or Amazon Web Services SDKs, the file must be in string format and special characters must be ignored. To format the file correctly, Amazon SNS recommends using the following command: SERVICE_JSON=$(jq @json < service.json). For MPNS, PlatformPrincipal is TLS certificate and PlatformCredential is private key. For WNS, PlatformPrincipal is Package Security Identifier and PlatformCredential is secret key. You can use the returned PlatformApplicationArn as an attribute for the CreatePlatformEndpoint action. |
create_platform_endpoint | insert | PlatformApplicationArn, Token, region | CustomUserData, Attributes | Creates an endpoint for a device and mobile app on one of the supported push notification services, such as GCM (Firebase Cloud Messaging) and APNS. CreatePlatformEndpoint requires the PlatformApplicationArn that is returned from CreatePlatformApplication. You can use the returned EndpointArn to send a message to a mobile app or by the Subscribe action for subscription to a topic. The CreatePlatformEndpoint action is idempotent, so if the requester already owns an endpoint with the same device token and attributes, that endpoint's ARN is returned without creating a new endpoint. For more information, see Using Amazon SNS Mobile Push Notifications. When using CreatePlatformEndpoint with Baidu, two attributes must be provided: ChannelId and UserId. The token field must also contain the ChannelId. For more information, see Creating an Amazon SNS Endpoint for Baidu. |
delete_platform_application | delete | PlatformApplicationArn, region | Deletes a platform application object for one of the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging). For more information, see Using Amazon SNS Mobile Push Notifications. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
Name | string | Application names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long. |
Platform | string | The following platforms are supported: ADM (Amazon Device Messaging), APNS (Apple Push Notification Service), APNS_SANDBOX, and GCM (Firebase Cloud Messaging). |
PlatformApplicationArn | string | PlatformApplicationArn of platform application object to delete. |
Token | string | Unique identifier created by the notification service for an app on a device. The specific name for Token will vary, depending on which notification service is being used. For example, when using APNS as the notification service, you need the device token. Alternatively, when using GCM (Firebase Cloud Messaging) or ADM, the device token equivalent is called the registration ID. |
region | string | AWS region (default: us-east-1) |
Attributes | object | For a list of attributes, see SetEndpointAttributes . |
CustomUserData | string | Arbitrary user data to associate with the endpoint. Amazon SNS does not use this data. The data must be in UTF-8 format and less than 2KB. |
NextToken | string | NextToken string is used when calling ListPlatformApplications action to retrieve additional records that are available after the first page results. |
SELECT examples
- list_platform_applications
Lists the platform application objects for the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging). The results for ListPlatformApplications are paginated and return a limited list of applications, up to 100. If additional records are available after the first page results, then a NextToken string will be returned. To receive the next page, you call ListPlatformApplications using the NextToken string received from the previous call. When there are no more records to return, NextToken will be null. For more information, see Using Amazon SNS Mobile Push Notifications. This action is throttled at 15 transactions per second (TPS).
SELECT
attributes,
platform_application_arn
FROM aws.sns.platform_applications
WHERE region = '{{ region }}' -- required
AND NextToken = '{{ NextToken }}'
;
INSERT examples
- create_platform_application
- create_platform_endpoint
- Manifest
Creates a platform application object for one of the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging), to which devices and mobile apps may register. You must specify PlatformPrincipal and PlatformCredential attributes when using the CreatePlatformApplication action. PlatformPrincipal and PlatformCredential are received from the notification service. For ADM, PlatformPrincipal is client id and PlatformCredential is client secret. For APNS and APNS_SANDBOX using certificate credentials, PlatformPrincipal is SSL certificate and PlatformCredential is private key. For APNS and APNS_SANDBOX using token credentials, PlatformPrincipal is signing key ID and PlatformCredential is signing key. For Baidu, PlatformPrincipal is API key and PlatformCredential is secret key. For GCM (Firebase Cloud Messaging) using key credentials, there is no PlatformPrincipal. The PlatformCredential is API key. For GCM (Firebase Cloud Messaging) using token credentials, there is no PlatformPrincipal. The PlatformCredential is a JSON formatted private key file. When using the Amazon Web Services CLI or Amazon Web Services SDKs, the file must be in string format and special characters must be ignored. To format the file correctly, Amazon SNS recommends using the following command: SERVICE_JSON=$(jq @json < service.json). For MPNS, PlatformPrincipal is TLS certificate and PlatformCredential is private key. For WNS, PlatformPrincipal is Package Security Identifier and PlatformCredential is secret key. You can use the returned PlatformApplicationArn as an attribute for the CreatePlatformEndpoint action.
INSERT INTO aws.sns.platform_applications (
Name,
Platform,
region,
Attributes
)
SELECT
'{{ Name }}',
'{{ Platform }}',
'{{ region }}',
'{{ Attributes }}'
RETURNING
platform_application_arn
;
Creates an endpoint for a device and mobile app on one of the supported push notification services, such as GCM (Firebase Cloud Messaging) and APNS. CreatePlatformEndpoint requires the PlatformApplicationArn that is returned from CreatePlatformApplication. You can use the returned EndpointArn to send a message to a mobile app or by the Subscribe action for subscription to a topic. The CreatePlatformEndpoint action is idempotent, so if the requester already owns an endpoint with the same device token and attributes, that endpoint's ARN is returned without creating a new endpoint. For more information, see Using Amazon SNS Mobile Push Notifications. When using CreatePlatformEndpoint with Baidu, two attributes must be provided: ChannelId and UserId. The token field must also contain the ChannelId. For more information, see Creating an Amazon SNS Endpoint for Baidu.
INSERT INTO aws.sns.platform_applications (
PlatformApplicationArn,
Token,
region,
CustomUserData,
Attributes
)
SELECT
'{{ PlatformApplicationArn }}',
'{{ Token }}',
'{{ region }}',
'{{ CustomUserData }}',
'{{ Attributes }}'
RETURNING
endpoint_arn
;
# Description fields are for documentation purposes
- name: platform_applications
props:
- name: Name
value: "{{ Name }}"
description: Required parameter for the platform_applications resource.
- name: Platform
value: "{{ Platform }}"
description: Required parameter for the platform_applications resource.
- name: region
value: "{{ region }}"
description: Required parameter for the platform_applications resource.
- name: PlatformApplicationArn
value: "{{ PlatformApplicationArn }}"
description: Required parameter for the platform_applications resource.
- name: Token
value: "{{ Token }}"
description: Required parameter for the platform_applications resource.
- name: Attributes
value: "{{ Attributes }}"
description: For a list of attributes, see SetPlatformApplicationAttributes .
description: For a list of attributes, see SetPlatformApplicationAttributes .
- name: CustomUserData
value: "{{ CustomUserData }}"
description: Arbitrary user data to associate with the endpoint. Amazon SNS does not use this data. The data must be in UTF-8 format and less than 2KB.
description: Arbitrary user data to associate with the endpoint. Amazon SNS does not use this data. The data must be in UTF-8 format and less than 2KB.
DELETE examples
- delete_platform_application
Deletes a platform application object for one of the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging). For more information, see Using Amazon SNS Mobile Push Notifications.
DELETE FROM aws.sns.platform_applications
WHERE PlatformApplicationArn = '{{ PlatformApplicationArn }}' --required
AND region = '{{ region }}' --required
;