Untitled

mail@pastecode.io avatar
unknown
plain_text
19 days ago
860 B
2
Indexable
Never
def generate_gamma_sns_subscriptions
  <% non_optin_regions = [
    'ap-northeast-1',
    'us-east-1',
    'ap-south-1',
    'eu-north-1',
    'me-south-1',
    'eu-south-1'
    ] %>

  [
    <%- require 'json' -%>
    <%- @regions.each { |r| -%>
    <%- if r.arn_partition == "aws" -%>
    <%- unless non_optin_regions.include?(r.region_name) %>
    <%- cup_gamma_service_account_id  = r.service('upm-sdc-config').custom_properties["CUPServiceAccountID-gamma"] -%>
    <%- unless cup_gamma_service_account_id.to_s.strip.empty? %>
    {
      "sqsArn" => "<%= "arn:#{r.arn_partition}:sqs:#{r.region_name}:" %><%= cup_gamma_service_account_id %><%= ":cognito-idp-adms-subscriber-gamma-#{r.airport_code.downcase}" %>",
      "snsArn" => "arn:aws:sns:us-east-1:741443714515:RegionOptEvent-PreProd"
    },
    <%- end -%>
    <%- end -%>
    <%- end } -%>
  ]
end
Leave a Comment