Step 1. Locate the AMI Mapping tables

1.   Continue on from the last step in CTE020 – Subscribe to the LANSA Images. You should be viewing the template like this:

2.   Click the MasterStackApp Stack icon in the middle of the graph paper area. The icon will be surrounded by a red box. The master template will be displayed in the bottom pane.

3.   Copy the TemplateUrl value as shown below:

4.   Close the template window and click Create Stack and paste the Template URL into the Amazon S3 URL field and click View in Designer:

5.   Click Components tab and then Mappings tab.

6.   Copy the AWSRegionArch2AMI142 and AWSRegionArch2AMI15 mappings. AWSRegionArch2AMI142 contains the AMI IDs for LANSA Version 14 SP2. AWSRegionArch2AMI15 contains the AMI IDs for LANSA Version 15 GA.

7.   Now in order to evaluate the AMI correctly, the template will require parameters for the Windows OS version and the LANSA Version. This involves the following:
The parameters ImageSource, 11WebserverOSVersion and LansaVersion. The conditions IsCustomImageSource and IsLansaVersion142 and this value (JSON – equivalent YAML may be found in the template) to evaluate the AMI ID:

"AMI": {

    "Fn::If": [

        "IsCustomImageSource",

        {

            "Ref": "AMIId"

        },

        {

            "Fn::If": [

                "IsLansaVersion142",

                {

                    "Fn::FindInMap": [

                        "AWSRegionArch2AMI142",

                        {

                            "Ref": "AWS::Region"

                        },

                        {

                            "Ref": "11WebserverOSVersion"

                        }

                    ]

                },

                {

                    "Fn::FindInMap": [

                        "AWSRegionArch2AMI15",

                        {

                            "Ref": "AWS::Region"

                        },

                        {

                            "Ref": "11WebserverOSVersion"

                        }

                    ]

                }

            ]

        }

    ]

}