Repository: opsgenie/opsgenie-cloudformation-resources (language: python)

Issue:
Integration: Attribute 'IntegrationApiKey' does not exist.
I'm trying to create an Atlassian::Opsgenie::Integration and retrieve the IntegrationApiKey to use later in an AWS::SNS::Subscription by following the documentation at https://support.atlassian.com/opsgenie/docs/opsgenie-cloudformation-resources/

But CloudFormation is returning error: "Attribute 'IntegrationApiKey' does not exist."

```
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "Opsgenie Integration",
  "Resources": {
    "TestIntegrationTeam": {
      "Type": "Atlassian::Opsgenie::Team",
      "Properties": {
        "Name": "integration-test-team",
        "Description": "Test team to use with integration",
        "Members": []
      }
    },
    "TestIntegration": {
      "Type": "Atlassian::Opsgenie::Integration",
      "Properties": {
        "IntegrationType": "AmazonSns",
        "Name": "test-cfn-integration",
        "Enabled": true,
        "OwnerTeamName" : "integration-test-team",
        "AllowReadAccess": true,
        "AllowWriteAccess": true,
        "AllowDeleteAccess": true,
        "AllowConfigurationAccess": true,
        "Responders": [
          {
            "type": "team",
            "name": "integration-test-team"
          }
        ]
      },
      "DependsOn": [
        "TestIntegrationTeam"
      ]
    }
  },
  "Outputs": {
    "TeamId": {
      "Description": "Opsgenie TeamId",
      "Value": {
        "Fn::GetAtt": [
          "TestIntegrationTeam",
          "TeamId"
        ]
      }
    },
    "IntegrationId": {
      "Description": "Opsgenie IntegrationId",
      "Value": {
        "Fn::GetAtt": [
          "TestIntegration",
          "IntegrationId"
        ]
      }
    },
    "IntegrationApiKey": {
      "Description": "Opsgenie IntegrationApiKey",
      "Value": {
        "Fn::GetAtt": [
          "TestIntegration",
          "IntegrationApiKey"
        ]
      }
    }
  }
}

```


Discussion / hints:

Fix patch:
diff --git a/README.md b/README.md
index d6107f9..2bdb155 100644
--- a/README.md
+++ b/README.md
@@ -5,12 +5,12 @@
 
 *As for the April 8, 2022, we updated the SDK and our models.*
 
-That means if you try to update resources please be careful if rollback is enabled. New version(v2.0.0) users will not
-affected of this issue
+That means if you try to update resources please be careful if rollback is enabled. New version(v2.0.1) users will not
+be affected of this issue
 
-Current version : *v2.0.0*
+Current version : *v2.0.1*
 
-Old version: *v1.0.1*
+Old version: *v2.0.0*
 
 Models have been changed. From now on, you have to set typeConfiguration via AWS CLI or AWS Console. You are not able to
 set credentials in resource models.
@@ -59,14 +59,14 @@ https://github.com/aws-cloudformation/cloudformation-cli
 
 - Opsgenie User resource
 ```shell
-wget https://opsgeniedownloads.s3.us-west-2.amazonaws.com/cloudformation/atlassian-opsgenie-user-v2.0.0.zip
+wget https://opsgeniedownloads.s3.us-west-2.amazonaws.com/cloudformation/atlassian-opsgenie-user-v2.0.1.zip
 
-aws s3 cp atlassian-opsgenie-user-v2.0.0.zip s3://$BUCKET_NAME
+aws s3 cp atlassian-opsgenie-user-v2.0.1.zip s3://$BUCKET_NAME
 
 aws cloudformation register-type \
 --region us-west-2 \
 --type-name "Atlassian::Opsgenie::User" \
---schema-handler-package "s3://$BUCKET_NAME/atlassian-opsgenie-user-v2.0.0.zip" \
+--schema-handler-package "s3://$BUCKET_NAME/atlassian-opsgenie-user-v2.0.1.zip" \
 --type RESOURCE > registration_token.json
 
 aws cloudformation describe-type-registration --registration-token $REGISTRATION_TOKEN
@@ -76,14 +76,14 @@ aws cloudformation set-type-default-version --arn $TYPE_VERSION_ARN
 
 - Opsgenie Team resource
 ```shell
-wget https://opsgeniedownloads.s3.us-west-2.amazonaws.com/cloudformation/atlassian-opsgenie-team-v2.0.0.zip
+wget https://opsgeniedownloads.s3.us-west-2.amazonaws.com/cloudformation/atlassian-opsgenie-team-v2.0.1.zip
 
-aws s3 cp atlassian-opsgenie-team-v2.0.0.zip s3://$BUCKET_NAME
+aws s3 cp atlassian-opsgenie-team-v2.0.1.zip s3://$BUCKET_NAME
 
 aws cloudformation register-type \
 --region us-west-2 \
 --type-name "Atlassian::Opsgenie::Team" \
---schema-handler-package "s3://$BUCKET_NAME/atlassian-opsgenie-team-v2.0.0.zip" \
+--schema-handler-package "s3://$BUCKET_NAME/atlassian-opsgenie-team-v2.0.1.zip" \
 --type RESOURCE > registration_token.json
 
 aws cloudformation describe-type-registration --registration-token $REGISTRATION_TOKEN
@@ -94,14 +94,14 @@ aws cloudformation set-type-default-version --arn $TYPE_VERSION_ARN
 
 - Opsgenie Integration resource
 ```shell
-wget https://opsgeniedownloads.s3.us-west-2.amazonaws.com/cloudformation/atlassian-opsgenie-integration-v2.0.0.zip
+wget https://opsgeniedownloads.s3.us-west-2.amazonaws.com/cloudformation/atlassian-opsgenie-integration-v2.0.1.zip
 
-aws s3 cp atlassian-opsgenie-integration-v2.0.0.zip s3://$BUCKET_NAME
+aws s3 cp atlassian-opsgenie-integration-v2.0.1.zip s3://$BUCKET_NAME
 
 aws cloudformation register-type \
 --region us-west-2 \
 --type-name "Atlassian::Opsgenie::Integration" \
---schema-handler-package "s3://$BUCKET_NAME/atlassian-opsgenie-integration-v2.0.0.zip" \
+--schema-handler-package "s3://$BUCKET_NAME/atlassian-opsgenie-integration-v2.0.1.zip" \
 --type RESOURCE > registration_token.json
 
 aws cloudformation describe-type-registration --registration-token $REGISTRATION_TOKEN
diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml
index 2cc5632..1ac2c5d 100644
--- a/bitbucket-pipelines.yml
+++ b/bitbucket-pipelines.yml
@@ -121,7 +121,7 @@ pipelines:
             - export AWS_WEB_IDENTITY_TOKEN_FILE=$(pwd)/web-identity-token
             - export RESOURCE_NAME=Atlassian::Opsgenie::User
             - echo $BITBUCKET_STEP_OIDC_TOKEN > $(pwd)/web-identity-token
-            - ../user_script.sh
+            - ../script_with_delay.sh
             - ../test-check.sh
 
       - step:
diff --git a/examples/opsgenie_integration/stack.json b/examples/opsgenie_integration/stack.json
index 9c35fc4..82d0c52 100644
--- a/examples/opsgenie_integration/stack.json
+++ b/examples/opsgenie_integration/stack.json
@@ -51,6 +51,15 @@
           "IntegrationId"
         ]
       }
+    },
+    "IntegrationApiKey": {
+      "Description": "Opsgenie IntegrationApiKey",
+      "Value": {
+        "Fn::GetAtt": [
+          "TestIntegration",
+          "IntegrationApiKey"
+        ]
+      }
     }
   }
 }
diff --git a/integration_template.yml b/integration_template.yml
index 04989a7..ee075aa 100644
--- a/integration_template.yml
+++ b/integration_template.yml
@@ -13,7 +13,7 @@ Resources:
     Properties:
       Handler: com.atlassian.opsgenie.integration.HandlerWrapper::handleRequest
       Runtime: java8
-      CodeUri: opsgenie_integration/target/atlassian-opsgenie-integration-handler-2.0.0.jar
+      CodeUri: opsgenie_integration/target/atlassian-opsgenie-integration-handler-2.0.1.jar
       Timeout: 60
 
   TestEntrypoint:
@@ -21,5 +21,5 @@ Resources:
     Properties:
       Handler: com.atlassian.opsgenie.integration.HandlerWrapper::testEntrypoint
       Runtime: java8
-      CodeUri: opsgenie_integration/target/atlassian-opsgenie-integration-handler-2.0.0.jar
+      CodeUri: opsgenie_integration/target/atlassian-opsgenie-integration-handler-2.0.1.jar
       Timeout: 60
\ No newline at end of file
diff --git a/opsgenie_integration/atlassian-opsgenie-integration.json b/opsgenie_integration/atlassian-opsgenie-integration.json
index 3404966..d42d5d4 100644
--- a/opsgenie_integration/atlassian-opsgenie-integration.json
+++ b/opsgenie_integration/atlassian-opsgenie-integration.json
@@ -107,6 +107,10 @@
       "items": {
         "$ref": "#/definitions/respondersProperty"
       }
+    },
+    "OpsgenieApiEndpoint": {
+      "type": "string",
+      "pattern": "^https:\/\/api(\\.eu|\\.sandbox|)\\.opsgenie\\.com$"
     }
   },
   "required": [
@@ -115,11 +119,14 @@
     "Name"
   ],
   "primaryIdentifier": [
-    "/properties/IntegrationId"
+    "/properties/IntegrationId",
+    "/properties/IntegrationApiKey"
+
   ],
   "readOnlyProperties": [
     "/properties/IntegrationId",
-    "/properties/IntegrationApiKey"
+    "/properties/IntegrationApiKey",
+    "/properties/OpsgenieApiEndpoint"
   ],
   "writeOnlyProperties": [
     "/properties/OwnerTeamId"
diff --git a/opsgenie_integration/pom.xml b/opsgenie_integration/pom.xml
index f2557e7..0796456 100644
--- a/opsgenie_integration/pom.xml
+++ b/opsgenie_integration/pom.xml
@@ -8,13 +8,13 @@
     <groupId>com.atlassian.opsgenie.integration</groupId>
     <artifactId>atlassian-opsgenie-integration-handler</artifactId>
     <name>atlassian-opsgenie-integration-handler</name>
-    <version>2.0.0</version>
+    <version>2.0.1</version>
     <packaging>jar</packaging>
 
     <parent>
         <groupId>com.atlassian.opsgenie</groupId>
         <artifactId>opsgenie-cloudformation-resources</artifactId>
-        <version>2.0.0</version>
+        <version>2.0.1</version>
     </parent>
 
     <properties>
diff --git a/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/CreateHandler.java b/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/CreateHandler.java
index 94be966..d7a9b75 100644
--- a/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/CreateHandler.java
+++ b/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/CreateHandler.java
@@ -70,9 +70,9 @@ public ProgressEvent<ResourceModel, CallbackContext> handleRequest(AmazonWebServ
             createIntegrationRequest.setEnabled(model.getEnabled());
 
             CreateIntegrationResponse createIntegrationResponse = OGClient.CreateIntegration(createIntegrationRequest);
-            model.setIntegrationId(createIntegrationResponse.getData()
+            model.setIntegrationId(createIntegrationResponse.getDataModel()
                                                             .getId());
-            model.setIntegrationApiKey(createIntegrationResponse.getData()
+            model.setIntegrationApiKey(createIntegrationResponse.getDataModel()
                                                                 .getApiKey());
         } catch (OpsgenieClientException e) {
             return GetServiceFailureResponse(e.getCode(), e.getMessage());
diff --git a/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/ListHandler.java b/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/ListHandler.java
index 5b0b0ed..8a3593c 100644
--- a/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/ListHandler.java
+++ b/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/ListHandler.java
@@ -18,19 +18,22 @@ public ProgressEvent<ResourceModel, CallbackContext> handleRequest(AmazonWebServ
                                                                        Logger logger, TypeConfigurationModel typeConfiguration) {
 
         final List<ResourceModel> models = new ArrayList<>();
-        final ResourceModel model = request.getDesiredResourceState();
+        final ResourceModel desiredResourceState = request.getDesiredResourceState();
         try {
             OpsgenieClient OGClient = CreateOGClient(typeConfiguration);
-
             ListIntegrationResponse listIntegrationResponse = OGClient.ListIntegrations();
             listIntegrationResponse.getData()
                                    .stream()
                                    .forEach(dataModel -> {
-                                       ResourceModel resourceModel = new ResourceModel();
-                                       resourceModel.setName(dataModel.getName());
-                                       resourceModel.setIntegrationType(dataModel.getType());
-                                       resourceModel.setIntegrationId(dataModel.getId());
-                                       models.add(resourceModel);
+                                       if (dataModel.getId()
+                                               .equals(desiredResourceState.getIntegrationId())) {
+                                           ResourceModel resourceModel = new ResourceModel();
+                                           resourceModel.setName(dataModel.getName());
+                                           resourceModel.setIntegrationType(dataModel.getType());
+                                           resourceModel.setIntegrationId(dataModel.getId());
+                                           resourceModel.setIntegrationApiKey(desiredResourceState.getIntegrationApiKey());
+                                           models.add(resourceModel);
+                                       }
                                    });
         } catch (OpsgenieClientException e) {
             return GetServiceFailureResponse(e.getCode(), e.getMessage());
diff --git a/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/ReadHandler.java b/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/ReadHandler.java
index ca2a349..bb28814 100644
--- a/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/ReadHandler.java
+++ b/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/ReadHandler.java
@@ -18,7 +18,6 @@ public class ReadHandler extends BaseHandler<CallbackContext, TypeConfigurationM
     public ProgressEvent<ResourceModel, CallbackContext> handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext,
                                                                        Logger logger, TypeConfigurationModel typeConfiguration) {
 
-        final List<ResourceModel> models = new ArrayList<>();
         final ResourceModel model = request.getDesiredResourceState();
         try {
             OpsgenieClient OGClient = CreateOGClient(typeConfiguration);
@@ -49,6 +48,8 @@ public ProgressEvent<ResourceModel, CallbackContext> handleRequest(AmazonWebServ
             model.setResponders(getIntegrationResponse.getData()
                                                       .getRespondersPropertyList());
 
+            model.setOpsgenieApiEndpoint(typeConfiguration.getOpsgenieCredentials().getOpsgenieApiEndpoint());
+
         } catch (OpsgenieClientException e) {
             return GetServiceFailureResponse(e.getCode(), e.getMessage());
         } catch (IOException e) {
diff --git a/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/UpdateHandler.java b/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/UpdateHandler.java
index 9482342..61313fc 100644
--- a/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/UpdateHandler.java
+++ b/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/UpdateHandler.java
@@ -20,7 +20,6 @@ public class UpdateHandler extends BaseHandler<CallbackContext, TypeConfiguratio
     public ProgressEvent<ResourceModel, CallbackContext> handleRequest(AmazonWebServicesClientProxy proxy, ResourceHandlerRequest<ResourceModel> request, CallbackContext callbackContext,
                                                                        Logger logger, TypeConfigurationModel typeConfiguration) {
 
-        final List<ResourceModel> models = new ArrayList<>();
         final ResourceModel model = request.getDesiredResourceState();
         try {
             OpsgenieClient OGClient = CreateOGClient(typeConfiguration);
diff --git a/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/model/CreateIntegrationResponse.java b/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/model/CreateIntegrationResponse.java
index 3d3c088..16bbd95 100644
--- a/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/model/CreateIntegrationResponse.java
+++ b/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/model/CreateIntegrationResponse.java
@@ -1,11 +1,13 @@
 package com.atlassian.opsgenie.integration.model;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 @Data
 public class CreateIntegrationResponse {
 
-    private DataModel Data;
+    @JsonProperty("data")
+    private DataModel dataModel;
     private String requestId;
     private double took;
 }
diff --git a/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/model/DataModel.java b/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/model/DataModel.java
index 6ae180f..4e41cb2 100644
--- a/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/model/DataModel.java
+++ b/opsgenie_integration/src/main/java/com/atlassian/opsgenie/integration/model/DataModel.java
@@ -12,7 +12,7 @@
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class DataModel {
 
-    private String Id;
+    private String id;
     private String name;
     private String type;
     private String ownerTeamId;
diff --git a/opsgenie_team/pom.xml b/opsgenie_team/pom.xml
index e5d8549..6d2a140 100644
--- a/opsgenie_team/pom.xml
+++ b/opsgenie_team/pom.xml
@@ -9,13 +9,13 @@
     <parent>
         <groupId>com.atlassian.opsgenie</groupId>
         <artifactId>opsgenie-cloudformation-resources</artifactId>
-        <version>2.0.0</version>
+        <version>2.0.1</version>
     </parent>
 
     <groupId>com.atlassian.opsgenie.team</groupId>
     <artifactId>atlassian-opsgenie-team-handler</artifactId>
     <name>atlassian-opsgenie-team-handler</name>
-    <version>2.0.0</version>
+    <version>2.0.1</version>
     <packaging>jar</packaging>
 
     <properties>
diff --git a/opsgenie_team/src/main/java/com/atlassian/opsgenie/team/ListHandler.java b/opsgenie_team/src/main/java/com/atlassian/opsgenie/team/ListHandler.java
index dfb6410..93670cd 100644
--- a/opsgenie_team/src/main/java/com/atlassian/opsgenie/team/ListHandler.java
+++ b/opsgenie_team/src/main/java/com/atlassian/opsgenie/team/ListHandler.java
@@ -19,17 +19,19 @@ public ProgressEvent<ResourceModel, CallbackContext> handleRequest(AmazonWebServ
                                                                        Logger logger, TypeConfigurationModel typeConfiguration) {
 
         final List<ResourceModel> models = new ArrayList<>();
-        final ResourceModel model = request.getDesiredResourceState();
+        final ResourceModel desiredResourceState = request.getDesiredResourceState();
         try {
             OpsgenieClient OGClient = CreateOGClient(typeConfiguration);
 
             ListTeamResponse listTeamResponse = OGClient.ListTeam();
             for (TeamDataModel teamDataModel : listTeamResponse.getTeamDataModel()) {
-                models.add(ResourceModel.builder()
-                                        .teamId(teamDataModel.getId())
-                                        .name(teamDataModel.getName())
-                                        .description(teamDataModel.getDescription())
-                                        .build());
+                if (teamDataModel.getId().equals(desiredResourceState.getTeamId())){
+                    models.add(ResourceModel.builder()
+                            .teamId(teamDataModel.getId())
+                            .name(teamDataModel.getName())
+                            .description(teamDataModel.getDescription())
+                            .build());
+                }
             }
         } catch (OpsgenieClientException e) {
             return GetServiceFailureResponse(e.getCode(), e.getMessage());
diff --git a/opsgenie_user/pom.xml b/opsgenie_user/pom.xml
index 0e5cd47..ab332ff 100644
--- a/opsgenie_user/pom.xml
+++ b/opsgenie_user/pom.xml
@@ -8,13 +8,13 @@
     <parent>
         <groupId>com.atlassian.opsgenie</groupId>
         <artifactId>opsgenie-cloudformation-resources</artifactId>
-        <version>2.0.0</version>
+        <version>2.0.1</version>
     </parent>
 
     <groupId>com.atlassian.opsgenie.user</groupId>
     <artifactId>atlassian-opsgenie-user-handler</artifactId>
     <name>atlassian-opsgenie-user-handler</name>
-    <version>2.0.0</version>
+    <version>2.0.1</version>
     <packaging>jar</packaging>
 
     <properties>
diff --git a/opsgenie_user/src/main/java/com/atlassian/opsgenie/user/ListHandler.java b/opsgenie_user/src/main/java/com/atlassian/opsgenie/user/ListHandler.java
index f05ac46..158028d 100644
--- a/opsgenie_user/src/main/java/com/atlassian/opsgenie/user/ListHandler.java
+++ b/opsgenie_user/src/main/java/com/atlassian/opsgenie/user/ListHandler.java
@@ -19,19 +19,21 @@ public ProgressEvent<ResourceModel, CallbackContext> handleRequest(AmazonWebServ
                                                                        Logger logger, TypeConfigurationModel typeConfiguration) {
 
         final List<ResourceModel> models = new ArrayList<>();
-        final ResourceModel model = request.getDesiredResourceState();
+        final ResourceModel desiredResourceState = request.getDesiredResourceState();
         try {
             OpsgenieClient OGClient = CreateOGClient(typeConfiguration);
             Delay(typeConfiguration);
             ListUserResponse listUserResponse = OGClient.ListUsers();
             for (DataModel dataModel : listUserResponse.getDataModel()) {
-                ResourceModel resourceModel = new ResourceModel();
-                resourceModel.setRole(dataModel.getRole()
-                                               .getName());
-                resourceModel.setUsername(dataModel.getUsername());
-                resourceModel.setFullName(dataModel.getFullName());
-                resourceModel.setUserId(dataModel.getId());
-                models.add(resourceModel);
+                if (dataModel.getId().equals(desiredResourceState.getUserId())){
+                    ResourceModel resourceModel = new ResourceModel();
+                    resourceModel.setRole(dataModel.getRole()
+                            .getName());
+                    resourceModel.setUsername(dataModel.getUsername());
+                    resourceModel.setFullName(dataModel.getFullName());
+                    resourceModel.setUserId(dataModel.getId());
+                    models.add(resourceModel);
+                }
             }
         } catch (OpsgenieClientException e) {
             return GetServiceFailureResponse(e.getCode(), e.getMessage());
diff --git a/pom.xml b/pom.xml
index 3b47f0e..44082b2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
 
     <groupId>com.atlassian.opsgenie</groupId>
     <artifactId>opsgenie-cloudformation-resources</artifactId>
-    <version>2.0.0</version>
+    <version>2.0.1</version>
     <packaging>pom</packaging>
 
     <modules>
diff --git a/user_script.sh b/script_with_delay.sh
similarity index 100%
rename from user_script.sh
rename to script_with_delay.sh
diff --git a/team_template.yml b/team_template.yml
index 59170b5..e6b4107 100644
--- a/team_template.yml
+++ b/team_template.yml
@@ -13,7 +13,7 @@ Resources:
     Properties:
       Handler: com.atlassian.opsgenie.team.HandlerWrapper::handleRequest
       Runtime: java8
-      CodeUri: opsgenie_team/target/atlassian-opsgenie-team-handler-2.0.0.jar
+      CodeUri: opsgenie_team/target/atlassian-opsgenie-team-handler-2.0.1.jar
       Timeout: 60
 
   TestEntrypoint:
@@ -21,5 +21,5 @@ Resources:
     Properties:
       Handler: com.atlassian.opsgenie.team.HandlerWrapper::testEntrypoint
       Runtime: java8
-      CodeUri: opsgenie_team/target/atlassian-opsgenie-team-handler-2.0.0.jar
+      CodeUri: opsgenie_team/target/atlassian-opsgenie-team-handler-2.0.1.jar
       Timeout: 60
\ No newline at end of file
diff --git a/user_template.yml b/user_template.yml
index e160eb4..9dd79e7 100644
--- a/user_template.yml
+++ b/user_template.yml
@@ -13,7 +13,7 @@ Resources:
     Properties:
       Handler: com.atlassian.opsgenie.user.HandlerWrapper::handleRequest
       Runtime: java8
-      CodeUri: opsgenie_user/target/atlassian-opsgenie-user-handler-2.0.0.jar
+      CodeUri: opsgenie_user/target/atlassian-opsgenie-user-handler-2.0.1.jar
       Timeout: 60
 
   TestEntrypoint:
@@ -21,5 +21,5 @@ Resources:
     Properties:
       Handler: com.atlassian.opsgenie.user.HandlerWrapper::testEntrypoint
       Runtime: java8
-      CodeUri: opsgenie_user/target/atlassian-opsgenie-user-handler-2.0.0.jar
+      CodeUri: opsgenie_user/target/atlassian-opsgenie-user-handler-2.0.1.jar
       Timeout: 60
\ No newline at end of file


Test patch:
diff --git a/examples/e2e/complete.json b/examples/e2e/complete.json
index 5eede25..992e987 100644
--- a/examples/e2e/complete.json
+++ b/examples/e2e/complete.json
@@ -46,7 +46,7 @@
     "IntegrationTest": {
       "Type": "Atlassian::Opsgenie::Integration",
       "Properties": {
-        "IntegrationType": "API",
+        "IntegrationType": "AmazonSns",
         "Name": "test integration",
         "Responders": [
           {
@@ -64,6 +64,41 @@
       "DependsOn": [
         "TeamA"
       ]
+    },
+    "MySns": {
+      "Type": "AWS::SNS::Topic",
+      "Properties": {
+        "DisplayName": "opsgenie-test-cloudformation-topic",
+        "Subscription": [
+          {
+            "Endpoint": {
+              "Fn::Join": [
+                "",
+                [
+                  {
+                    "Fn::GetAtt": [
+                      "IntegrationTest",
+                      "OpsgenieApiEndpoint"
+                    ]
+                  },
+                  "/v1/json/amazonsns?apiKey=",
+                  {
+                    "Fn::GetAtt": [
+                      "IntegrationTest",
+                      "IntegrationApiKey"
+                    ]
+                  }
+                ]
+              ]
+            },
+            "Protocol": "https"
+          }
+        ],
+        "TopicName": "opsgenie-test-cloudformation-topic"
+      },
+      "DependsOn": [
+        "IntegrationTest"
+      ]
     }
   },
   "Outputs": {
@@ -102,6 +137,24 @@
           "IntegrationId"
         ]
       }
+    },
+    "IntegrationApiKey": {
+      "Description": "Opsgenie IntegrationApiKey",
+      "Value": {
+        "Fn::GetAtt": [
+          "IntegrationTest",
+          "IntegrationApiKey"
+        ]
+      }
+    },
+    "ApiEndpoint": {
+      "Description": "Opsgenie ApiEndpoint",
+      "Value": {
+        "Fn::GetAtt": [
+          "IntegrationTest",
+          "OpsgenieApiEndpoint"
+        ]
+      }
     }
   }
 }
\ No newline at end of file