Deploying multi-region AppSync API with latency-based routing custom-domain via CDK - amazon-cloudfront

I am attempting to deploy an AWS AppSync API into two AWS regions (accessible via the same hostname - using Route53 latency-based routing) using CDK.
I first ran into the issue that I couldn't deploy an AWS::AppSync::DomainName resource into the second region using the same custom-domain name as the first region, I was experiencing CloudFormation failures which stated:
Invalid request provided: CNAME already exists
This was my assumption about how this ought to be configured:
|-----------------------------|
| my-appsync-api.example.com |
| 2 CNAMES: 1 x ase2, 1 x ew1 |
|-----------------------------|
|
------------------------------------------
| |
|----------------------------| |----------------------------|
| my-appsync-api.example.com | | my-appsync-api.example.com |
| AppSync custom domain name | | AppSync custom domain name |
|----------------------------| |----------------------------|
| |
|---------------------| |--------------------|
| ase2.cloudfront.net | | ew1.cloudfront.net |
|---------------------| |--------------------|
| |
|---------| |---------|
| AppSync | | AppSync |
|---------| |---------|
Given I had setup my Route53 records as CNAMES, I assumed that I should change those to be A records using AWS' alias feature to point at the AppSync domain name. However, although this is possible via the Route53 console, it is not possible via the CDK. When I tried to set this up, I found that there is currently no Route53 target for AppSync (as there is for ApiGateway, CloudFront etc...).
My next attempt was to configure region-specific custom-domain names for each AWS::AppSync::DomainName resources, and create region-specific CNAMES for each; then finally create latency-based routing A records with the desired domain name which route to their respective region-specific domain:
|-----------------------------|
| my-appsync-api.example.com |
| 2 CNAMES: 1 x ase2, 1 x ew1 |
|-----------------------------|
|
-------------------------------------------
| |
|---------------------------------| |--------------------------------|
| my-ase2-appsync-api.example.com | | my-ew1-appsync-api.example.com |
| CNAME for ase2 | | CNAME for ew1 |
|---------------------------------| |--------------------------------|
| |
|---------------------------------| |--------------------------------|
| my-ase2-appsync-api.example.com | | my-ew1-appsync-api.example.com |
| AppSync custom domain name | | AppSync custom domain name |
|---------------------------------| |--------------------------------|
| |
|---------------------| |--------------------|
| ase2.cloudfront.net | | ew1.cloudfront.net |
|---------------------| |--------------------|
| |
|---------| |---------|
| AppSync | | AppSync |
|---------| |---------|
Alas, this did not work either, I ended up with an SSL issue, I assume because the CloudFront distribution (under the hood of AppSync) was configured with the region-specific domain.
It looks to me like the only option I have (given it appears that you can only have AWS::AppSync::DomainName resources with unique custom domain names) is to have a unique custom domain name per-region and then pop an API Gateway proxy in-front of AppSync... although, it adds around 200ms (at least) of latency this way. It'd be great if there was a better way.

Have you seen this blog post by AWS?
The setup looks like something you try to achieve.

Related

Azure log analytics query for how much and what data has vm consumed

I would like to have query that would return something like for single vm. So query should be showing results of single vm and what kinda log type / solutions it has used and how much.
I don't know if this is even possible to do anything similar maybe? Tips?
With this query I'm able to list total usage for all vm's reporting to laws but I would like to have more details about a single vm
find where TimeGenerated > ago(30d) project _BilledSize, _IsBillable, Computer
| where _IsBillable == true
| extend computerName = tolower(tostring(split(Computer, '.')[0]))
| summarize BillableDataBytes = sum(_BilledSize) by computerName
| sort by BillableDataBytes nulls last
Mostly you would be able to accomplish it by querying standard columns or properties _BilledSize, Type, _IsBillable and Computer.
Below is the sample query for your reference:
union withsource=tt *
| where TimeGenerated between (ago(7d) .. now())
| where _IsBillable == true
| where isnotempty(Computer)
| where Computer == "MM-VM-RHEL-7"
| summarize BillableDataBytes = sum(_BilledSize) by Computer, _IsBillable, Type
| render piechart
Below is the screenshot for illustration:
Related references:
Log data usage - Understanding ingested data volume
Standard columns in logs

Difference between ARM SKU Name and SKU Name in Azure EA

I have been working with the Azure Consumption APIs and I noticed that these two APIs return very similar variables with different names:
The reservationcharges endpoint defines armSkuName as:
+-----------------------+---------+----------------------------------------------+
| Property Name | Type | Description |
+-----------------------+---------+----------------------------------------------+
| armSkuName | string | String representing the purchased resource. |
+-----------------------+---------+----------------------------------------------+
The reservationsummaries endpoint defines skuName as:
+-----------------------+---------+----------------------------------------------+
| Property Name | Type | Description |
+-----------------------+---------+----------------------------------------------+
| skuName | string | String representing the purchased resource. |
+-----------------------+---------+----------------------------------------------+
I know that ARM SKU means Azure Resource Manager Stock Keeping Unit and SKU means Stock Keeping Unit, but I'm unclear on the distinction between the two?
Is the armSkuName specifically naming it as an ARM SKU as opposed to a classic ASM SKU? Does skuName encompass both?
Are there any Azure docs that explain the distinction between the two? Is there a distinction to make?

How can I get an updated server parameter to take effect in Azure Database for MySQL?

In the Azure portal I set the value of server parameter lower_case_table_names to 2 and successfully saved, but when I login to the server the change is not reflected:
mysql> SHOW VARIABLES LIKE 'lower%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_file_system | ON |
| lower_case_table_names | 1 |
+------------------------+-------+
2 rows in set (0.26 sec)
What can I do for this change to take effect?
You probably need to trigger a server restart, the problem is, as far as I remember, that Azure Database for MySQL doesn't support it directly.
The workaround is to scale the vCores of the server up and then back down to trigger a restart.
Hope it helps!

#After is invoked multiple times at the end of Scenario Outline in Cucumber

My cucumber Gherkins look like this:
Feature: Story XYZ- Title of Story
"""
Title: Story XYZ- Title of Story
"""
Background:
Given Appointments are being created using "SOAP" API
#scenario1
Scenario Outline: Create an appointment for a New start service order
Given Appointment does not exist for order id "Test_PR_Order123"
When Request for create appointment is received for order "Test_PR_Order123" and following
| FieldName | FieldValue |
| ServiceGroupName | <ServiceGroupName> |
| SerivceGroupID | TestSG123 |
| ServiceType | <ServiceType> |
Then Appointment ID should be created
And Appointment for order "Test_PR_Order123" should have following details
| FieldName | FieldValue |
| ServiceGroupName | <ServiceGroupName> |
| SerivceGroupID | TestSG123 |
| ServiceType | <ServiceType> |
And Appointment history should exist for "Create Appointment"
Examples:
| ServiceType | ServiceGroupName |
| Service1 | ServiceGroup1 |
| Service2 | ServiceGroup2 |
#scenario22
Scenario Outline: Create an appointment for a Change Service order
Given Appointment does not exist for order id "Test_CH_Order123"
When Request for create appointment is received for order "Test_CH_Order123" and following
| FieldName | FieldValue |
| ServiceGroupName | <ServiceGroupName> |
| SerivceGroupID | TestSG123 |
| ServiceType | <ServiceType> |
Then Appointment ID should be created
And Appointment for order "Test_CH_Order123" should have following details
| FieldName | FieldValue |
| ServiceGroupName | <ServiceGroupName> |
| SerivceGroupID | TestSG123 |
| ServiceType | <ServiceType> |
And Appointment history should exist for "Create Appointment"
Examples:
| ServiceType | ServiceGroupName |
| Service1 | ServiceGroup1 |
| Service2 | ServiceGroup2 |
In above feature there is a background which will execute for each example in both Scenario Outline.
Also, in java implementation we have implemented #After and #Before hooks which will also execute for each example.
We are using spring-cucumber for data injection between steps.
Problem occurs when all examples in first scenario outline ends, #After implemented method is invoked 2 times. When 2nd time #After starts at the same time 2nd Scenario Outline examples start executing.
As a result sequential execution of scenarios is disturbed and automation start to fail.
Please suggest if this is a bug in cucumber or we are missing anything.
One of the many things you are missing is keeping scenarios simple. By using a scenario outlines and by embedding so many technical details in your Gherkin you are making things much harder for yourself. In addition you are using before and after hooks to make this work.
Another problem is that your scenarios do not make sense. They are all about making appointments for orders, but your don't at any point create the order.
Finally you have two identical scenarios that you say do different things. The first is for New, the second is for Change. There has to be some difference otherwise you would not need the second scenario.
What I would do is try and extract a single scenario out of this tangle and use that to diagnose any problems. You should be able to end up with something like
Scenario: Create an appointment for an order
Given there is an order
And appointments are made using SOAP
When a new start appointment is made for the order
Then the appointment should be created
And the appointment should have a history
There should be no reason why you can't make this scenario work without any #before or #after. When you have this working then create other scenarios whatever other cases you are trying to examine. Again you should be able to do this without doing any of the following
Using example data to differentiate between scenarios
Using outlines
Using #before and #after
When using Cucumber you want to push the complexity of automation outside of Cucumber. Either pull it up to script before Cucumber starts, or push it down to execute in helper methods that are called in a single step definition. If you keep the complexity in Cucumber and in particular try and link scenarios to each other and use #before and #after to keep state between scenarios you will not have a pleasant time using (misusing) Cucumber.
Its far more likely that your problems are caused by your code than by Cucumbers. Even if Cucumber did have a problem with outlines and hooks, you can fix your problems by just not using them. Outlines are completely unnecessary and hooks are mostly misused.

Sharepoint 2007 Custom permission level to manage permissions

I have a problem: I need to add custom permission level to sharepoint, that grants access to manage permissions and view (read only) pages.
The permission levels that I set to the permission level are:
SPBasePermissions.Open
| SPBasePermissions.ApproveItems
| SPBasePermissions.ViewListItems
| SPBasePermissions.OpenItems
| SPBasePermissions.ViewVersions
| SPBasePermissions.ViewPages
| SPBasePermissions.BrowseDirectories
| SPBasePermissions.EnumeratePermissions
| SPBasePermissions.BrowseUserInfo
| SPBasePermissions.CreateGroups
| SPBasePermissions.ViewFormPages
| SPBasePermissions.ManagePermissions;
I can Add Groups but "Add user" is unvisible. What I am missing here?
thx!
also include SPBasePermissions.ManageLists

Resources