Resource: aws_sns_platform_application

Provides an SNS platform application resource

Example Usage

Apple Push Notification Service (APNS) using certificate-based authentication

resource "aws_sns_platform_application" "apns_application" {
  name                = "apns_application"
  platform            = "APNS"
  platform_credential = "<APNS PRIVATE KEY>"
  platform_principal  = "<APNS CERTIFICATE>"
}

Apple Push Notification Service (APNS) using token-based authentication

resource "aws_sns_platform_application" "apns_application" {
  name                     = "apns_application"
  platform                 = "APNS"
  platform_credential      = "<APNS SIGNING KEY>"
  platform_principal       = "<APNS SIGNING KEY ID>"
  apple_platform_team_id   = "<APPLE TEAM ID>"
  apple_platform_bundle_id = "<APPLE BUNDLE ID>"
}

Google Cloud Messaging (GCM)

resource "aws_sns_platform_application" "gcm_application" {
  name                = "gcm_application"
  platform            = "GCM"
  platform_credential = "<GCM API KEY>"
}

Argument Reference

This resource supports the following arguments:

The following attributes are needed only when using APNS token credentials:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import SNS platform applications using the ARN. For example:

import {
  to = aws_sns_platform_application.gcm_application
  id = "arn:aws:sns:us-west-2:0123456789012:app/GCM/gcm_application"
}

Using terraform import, import SNS platform applications using the ARN. For example:

% terraform import aws_sns_platform_application.gcm_application arn:aws:sns:us-west-2:0123456789012:app/GCM/gcm_application