not able to notarize electron app using forge - electron

hello I am building electron app for the mac platform and having trouble notarize the app using Forge and getting this error:
Packaging ApplicationWARNING: Code sign failed; please retry manually. Error: Command failed: spctl --assess --type execute --verbose --ignore-cache --no-cache /var/folders/q7//T/electron-packager/darwin-arm64/Integration-darwin-arm64/Integration.app
/var/folders/q7/*/T/electron-packager/darwin-arm64/Integration-darwin-arm64/Integration.app: rejected
source=Unnotarized Developer ID
my forge config
"forge": {
"packagerConfig": {
"appBundleId": "com.anyfolder.integrations",
"osxSign": {
"identity": "Developer ID Application: ****** (****)",
"hardened-runtime": true,
"entitlements": "entitlements.plist",
"entitlements-inherit": "entitlements.plist",
"signature-flags": "library"
},
"osxNotarize": {
"appleId": "myid#id.com",
"appleIdPassword": "my-password"
},
"protocols": [
{
"name": "Any Folder",
"schemes": [
"electron-****"
]
}
],
"icon": "public/images/icon.ico"
},
"publishers": [
{
"name": "#electron-forge/publisher-s3",
"config": {
"bucket": "*******",
"folder": "integrations",
"public": true
}
},
{
"name": "#electron-forge/publisher-github",
"config": {
"repository": {
"owner": "****",
"name": "****"
},
"draft": false,
"prerelease": false
}
}
],
"makers": [
{
"name": "#electron-forge/maker-squirrel",
"config": {
"name": "integrations"
}
},
{
"name": "#electron-forge/maker-dmg",
"config": {
"icon": "public/images/icon.icns",
"format": "ULFO",
"name": "Name",
"overwrite": true,
"debug": true
}
}
],
"plugins": [
[
"#electron-forge/plugin-webpack",
{
"mainConfig": "./webpack.main.config.js",
"renderer": {
"config": "./webpack.renderer.config.js",
"entryPoints": [
{
"html": "./src/render/imageEditor/index.html",
"js": "./src/render/imageEditor/index.tsx",
"name": "capture_window",
"preload": {
"js": "./src/render/imageEditor/preload.ts"
}
},
{
"name": "main_window",
"html": "./src/index.html",
"js": "./src/render/main/index.tsx",
"preload": {
"js": "./src/render/main/preload.ts"
}
},
{
"name": "integrations_menu",
"html": "./src/index.html",
"js": "./src/render/integrations/index.tsx",
"preload": {
"js": "./src/render/integrations/preload.ts"
}
}
]
}
}
]
]
}

Related

How can I set the filename of the created .deb file when building my Electron.NET application for Linux?

This is my electron.manifest.json
{
"executable": "MyApplication.UI",
"splashscreen": {
"imageFile": "/wwwroot/assets/Animation.svg"
},
"author": "MyCompany",
"environment": "Production",
"singleInstance": false,
"build": {
"appId": "com.mycompany.myapplication",
"productName": "MyApplication",
"copyright": "Copyright # 2022",
"buildVersion": "2022.1.0",
"compression": "maximum",
"fileAssociations": [
{
"ext": "sdg",
"name": "MyApplication File",
"role": "Editor"
}
],
"publish": {
"provider": "generic",
"url": "https://mydomain.io/Installer/MyApplication/",
"channel": "latest"
},
"nsis": {
"allowToChangeInstallationDirectory": true,
"oneClick": false,
"perMachine": true,
"installerIcon": "bin/Assets/icon.ico",
"uninstallerIcon": "bin/Assets/icon.ico",
"installerHeaderIcon": "bin/Assets/icon.ico",
"menuCategory": true
},
"win": {
"target": [
"nsis"
],
"icon": "Assets/icon.ico"
},
"linux": {
"target": "deb",
"maintainer": "MyCompany",
"vendor": "MyCompany",
"synopsis": "MyApplication",
"executableName": "MyApplication",
"description": "Doing some magic.",
"category": "Development",
"icon": "./../../Assets/Icons/32x32.png"
},
"directories": {
"output": "../../../bin/Installer",
"buildResources": "Assets"
},
"extraResources": [
{
"from": "./bin",
"to": "bin",
"filter": [
"**/*"
]
}
],
"files": [
{
"from": "./ElectronHostHook/node_modules",
"to": "ElectronHostHook/node_modules",
"filter": [
"**/*"
]
},
"**/*"
]
}
}
The created .deb file when building for linux is called electron-net_{version}.deb. That wouldn't be a problem but when executed, the application name electron-net is shown.
How can I change that? I checked the documentation (here https://www.electron.build/configuration/linux) already but I dont see any more options in my config?
I am using ElectronNET.CLI Version 15.5.1 on Ubuntu 20.04.4, .NET Version 5.0.406
I think you're looking for the artifactName property under build for your file name and the name property under at root for the name that is displayed
{
"name" : "MyApplication",
"executable" : "MyApplication",
"build": {
"artifactName": "my-application.${ext}",
}
}

Cloudformation stacks, then how can I find the reason or log

When deploying from template,
This service is stack as CREATE_IN_PROGRESS
ServiceD69D759B arn:aws:ecs:ap-northeast-1:6781002281XX:service/AdminCluster/CdkFargateStack-ServiceD69D759B-sm274jjTfbP7 AWS::ECS::Service CREATE_IN_PROGRESS Resource creation Initiated -
However I have no idea where to start.
This docker image receive the access from 8011, so in local
it works in local like this
docker run -p 8011:8011 -it st_admin_site:latest
I check CloudWatch but can't find the log.
This is my cdk command
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const cluster = new ecs.Cluster(this, "SampleCluster", {
clusterName: "AdminCluster"
});
const adminImage = ecs.ContainerImage.fromRegistry('st_admin_site:latest');
const taskDefinition = new ecs.FargateTaskDefinition(this, "TaskDef");
const container = taskDefinition.addContainer("DefaultContainer", {
image: adminImage,
memoryLimitMiB: 512,
cpu: 256
});
container.addPortMappings({
containerPort: 8011
});
const ecsService = new ecs.FargateService(this, "Service", {
cluster,
taskDefinition,
desiredCount: 2
});
const lb = new elb.ApplicationLoadBalancer(this, "LB", {
vpc: cluster.vpc,
internetFacing: true
});
const listener = lb.addListener("Listener", { port: 80 });
const targetGroup = listener.addTargets("ECS", {
protocol: elb.ApplicationProtocol.HTTP,
port: 8011,
targets: [ecsService]
});
And it makes the template.
{
"Resources": {
"SampleClusterB4B72990": {
"Type": "AWS::ECS::Cluster",
"Properties": {
"ClusterName": "AdminCluster"
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Resource"
}
},
"SampleClusterVpcD1C6ABD9": {
"Type": "AWS::EC2::VPC",
"Properties": {
"CidrBlock": "10.0.0.0/16",
"EnableDnsHostnames": true,
"EnableDnsSupport": true,
"InstanceTenancy": "default",
"Tags": [
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/Resource"
}
},
"SampleClusterVpcPublicSubnet1SubnetE377A512": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"CidrBlock": "10.0.0.0/18",
"VpcId": {
"Ref": "SampleClusterVpcD1C6ABD9"
},
"AvailabilityZone": {
"Fn::Select": [
0,
{
"Fn::GetAZs": ""
}
]
},
"MapPublicIpOnLaunch": true,
"Tags": [
{
"Key": "aws-cdk:subnet-name",
"Value": "Public"
},
{
"Key": "aws-cdk:subnet-type",
"Value": "Public"
},
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet1"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet1/Subnet"
}
},
"SampleClusterVpcPublicSubnet1RouteTable7114D244": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "SampleClusterVpcD1C6ABD9"
},
"Tags": [
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet1"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet1/RouteTable"
}
},
"SampleClusterVpcPublicSubnet1RouteTableAssociation0B5402E3": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"RouteTableId": {
"Ref": "SampleClusterVpcPublicSubnet1RouteTable7114D244"
},
"SubnetId": {
"Ref": "SampleClusterVpcPublicSubnet1SubnetE377A512"
}
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet1/RouteTableAssociation"
}
},
"SampleClusterVpcPublicSubnet1DefaultRoute28A82BC4": {
"Type": "AWS::EC2::Route",
"Properties": {
"RouteTableId": {
"Ref": "SampleClusterVpcPublicSubnet1RouteTable7114D244"
},
"DestinationCidrBlock": "0.0.0.0/0",
"GatewayId": {
"Ref": "SampleClusterVpcIGW21649D5C"
}
},
"DependsOn": [
"SampleClusterVpcVPCGW39AFB859"
],
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet1/DefaultRoute"
}
},
"SampleClusterVpcPublicSubnet1EIPD2C3FC83": {
"Type": "AWS::EC2::EIP",
"Properties": {
"Domain": "vpc",
"Tags": [
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet1"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet1/EIP"
}
},
"SampleClusterVpcPublicSubnet1NATGateway715FE613": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "SampleClusterVpcPublicSubnet1SubnetE377A512"
},
"AllocationId": {
"Fn::GetAtt": [
"SampleClusterVpcPublicSubnet1EIPD2C3FC83",
"AllocationId"
]
},
"Tags": [
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet1"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet1/NATGateway"
}
},
"SampleClusterVpcPublicSubnet2SubnetB88D2B08": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"CidrBlock": "10.0.64.0/18",
"VpcId": {
"Ref": "SampleClusterVpcD1C6ABD9"
},
"AvailabilityZone": {
"Fn::Select": [
1,
{
"Fn::GetAZs": ""
}
]
},
"MapPublicIpOnLaunch": true,
"Tags": [
{
"Key": "aws-cdk:subnet-name",
"Value": "Public"
},
{
"Key": "aws-cdk:subnet-type",
"Value": "Public"
},
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet2"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet2/Subnet"
}
},
"SampleClusterVpcPublicSubnet2RouteTable8A11EEAD": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "SampleClusterVpcD1C6ABD9"
},
"Tags": [
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet2"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet2/RouteTable"
}
},
"SampleClusterVpcPublicSubnet2RouteTableAssociation857BF408": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"RouteTableId": {
"Ref": "SampleClusterVpcPublicSubnet2RouteTable8A11EEAD"
},
"SubnetId": {
"Ref": "SampleClusterVpcPublicSubnet2SubnetB88D2B08"
}
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet2/RouteTableAssociation"
}
},
"SampleClusterVpcPublicSubnet2DefaultRouteFD4087CF": {
"Type": "AWS::EC2::Route",
"Properties": {
"RouteTableId": {
"Ref": "SampleClusterVpcPublicSubnet2RouteTable8A11EEAD"
},
"DestinationCidrBlock": "0.0.0.0/0",
"GatewayId": {
"Ref": "SampleClusterVpcIGW21649D5C"
}
},
"DependsOn": [
"SampleClusterVpcVPCGW39AFB859"
],
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet2/DefaultRoute"
}
},
"SampleClusterVpcPublicSubnet2EIPCB2281EA": {
"Type": "AWS::EC2::EIP",
"Properties": {
"Domain": "vpc",
"Tags": [
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet2"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet2/EIP"
}
},
"SampleClusterVpcPublicSubnet2NATGatewayB385D543": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "SampleClusterVpcPublicSubnet2SubnetB88D2B08"
},
"AllocationId": {
"Fn::GetAtt": [
"SampleClusterVpcPublicSubnet2EIPCB2281EA",
"AllocationId"
]
},
"Tags": [
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet2"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PublicSubnet2/NATGateway"
}
},
"SampleClusterVpcPrivateSubnet1Subnet24256A44": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"CidrBlock": "10.0.128.0/18",
"VpcId": {
"Ref": "SampleClusterVpcD1C6ABD9"
},
"AvailabilityZone": {
"Fn::Select": [
0,
{
"Fn::GetAZs": ""
}
]
},
"MapPublicIpOnLaunch": false,
"Tags": [
{
"Key": "aws-cdk:subnet-name",
"Value": "Private"
},
{
"Key": "aws-cdk:subnet-type",
"Value": "Private"
},
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc/PrivateSubnet1"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PrivateSubnet1/Subnet"
}
},
"SampleClusterVpcPrivateSubnet1RouteTable55080EB4": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "SampleClusterVpcD1C6ABD9"
},
"Tags": [
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc/PrivateSubnet1"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PrivateSubnet1/RouteTable"
}
},
"SampleClusterVpcPrivateSubnet1RouteTableAssociationBC171CD8": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"RouteTableId": {
"Ref": "SampleClusterVpcPrivateSubnet1RouteTable55080EB4"
},
"SubnetId": {
"Ref": "SampleClusterVpcPrivateSubnet1Subnet24256A44"
}
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PrivateSubnet1/RouteTableAssociation"
}
},
"SampleClusterVpcPrivateSubnet1DefaultRouteB1C5B147": {
"Type": "AWS::EC2::Route",
"Properties": {
"RouteTableId": {
"Ref": "SampleClusterVpcPrivateSubnet1RouteTable55080EB4"
},
"DestinationCidrBlock": "0.0.0.0/0",
"NatGatewayId": {
"Ref": "SampleClusterVpcPublicSubnet1NATGateway715FE613"
}
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PrivateSubnet1/DefaultRoute"
}
},
"SampleClusterVpcPrivateSubnet2Subnet25DCB36D": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"CidrBlock": "10.0.192.0/18",
"VpcId": {
"Ref": "SampleClusterVpcD1C6ABD9"
},
"AvailabilityZone": {
"Fn::Select": [
1,
{
"Fn::GetAZs": ""
}
]
},
"MapPublicIpOnLaunch": false,
"Tags": [
{
"Key": "aws-cdk:subnet-name",
"Value": "Private"
},
{
"Key": "aws-cdk:subnet-type",
"Value": "Private"
},
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc/PrivateSubnet2"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PrivateSubnet2/Subnet"
}
},
"SampleClusterVpcPrivateSubnet2RouteTable35B9289E": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "SampleClusterVpcD1C6ABD9"
},
"Tags": [
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc/PrivateSubnet2"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PrivateSubnet2/RouteTable"
}
},
"SampleClusterVpcPrivateSubnet2RouteTableAssociationC174EB56": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"RouteTableId": {
"Ref": "SampleClusterVpcPrivateSubnet2RouteTable35B9289E"
},
"SubnetId": {
"Ref": "SampleClusterVpcPrivateSubnet2Subnet25DCB36D"
}
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PrivateSubnet2/RouteTableAssociation"
}
},
"SampleClusterVpcPrivateSubnet2DefaultRoute74AE4D72": {
"Type": "AWS::EC2::Route",
"Properties": {
"RouteTableId": {
"Ref": "SampleClusterVpcPrivateSubnet2RouteTable35B9289E"
},
"DestinationCidrBlock": "0.0.0.0/0",
"NatGatewayId": {
"Ref": "SampleClusterVpcPublicSubnet2NATGatewayB385D543"
}
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/PrivateSubnet2/DefaultRoute"
}
},
"SampleClusterVpcIGW21649D5C": {
"Type": "AWS::EC2::InternetGateway",
"Properties": {
"Tags": [
{
"Key": "Name",
"Value": "CdkFargateStack/SampleCluster/Vpc"
}
]
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/IGW"
}
},
"SampleClusterVpcVPCGW39AFB859": {
"Type": "AWS::EC2::VPCGatewayAttachment",
"Properties": {
"VpcId": {
"Ref": "SampleClusterVpcD1C6ABD9"
},
"InternetGatewayId": {
"Ref": "SampleClusterVpcIGW21649D5C"
}
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/SampleCluster/Vpc/VPCGW"
}
},
"TaskDefTaskRole1EDB4A67": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "ecs-tasks.amazonaws.com"
}
}
],
"Version": "2012-10-17"
}
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/TaskDef/TaskRole/Resource"
}
},
"TaskDef54694570": {
"Type": "AWS::ECS::TaskDefinition",
"Properties": {
"ContainerDefinitions": [
{
"Cpu": 256,
"Essential": true,
"Image": "st_admin_site:latest",
"Memory": 512,
"Name": "DefaultContainer",
"PortMappings": [
{
"ContainerPort": 8011,
"Protocol": "tcp"
}
]
}
],
"Cpu": "256",
"Family": "CdkFargateStackTaskDef424235B4",
"Memory": "512",
"NetworkMode": "awsvpc",
"RequiresCompatibilities": [
"FARGATE"
],
"TaskRoleArn": {
"Fn::GetAtt": [
"TaskDefTaskRole1EDB4A67",
"Arn"
]
}
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/TaskDef/Resource"
}
},
"ServiceD69D759B": {
"Type": "AWS::ECS::Service",
"Properties": {
"Cluster": {
"Ref": "SampleClusterB4B72990"
},
"DeploymentConfiguration": {
"MaximumPercent": 200,
"MinimumHealthyPercent": 50
},
"DesiredCount": 2,
"EnableECSManagedTags": false,
"HealthCheckGracePeriodSeconds": 60,
"LaunchType": "FARGATE",
"LoadBalancers": [
{
"ContainerName": "DefaultContainer",
"ContainerPort": 8011,
"TargetGroupArn": {
"Ref": "LBListenerECSGroup1D445DF5"
}
}
],
"NetworkConfiguration": {
"AwsvpcConfiguration": {
"AssignPublicIp": "DISABLED",
"SecurityGroups": [
{
"Fn::GetAtt": [
"ServiceSecurityGroupC96ED6A7",
"GroupId"
]
}
],
"Subnets": [
{
"Ref": "SampleClusterVpcPrivateSubnet1Subnet24256A44"
},
{
"Ref": "SampleClusterVpcPrivateSubnet2Subnet25DCB36D"
}
]
}
},
"TaskDefinition": {
"Ref": "TaskDef54694570"
}
},
"DependsOn": [
"LBListenerECSGroup1D445DF5",
"LBListener49E825B4"
],
"Metadata": {
"aws:cdk:path": "CdkFargateStack/Service/Service"
}
},
"ServiceSecurityGroupC96ED6A7": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "CdkFargateStack/Service/SecurityGroup",
"SecurityGroupEgress": [
{
"CidrIp": "0.0.0.0/0",
"Description": "Allow all outbound traffic by default",
"IpProtocol": "-1"
}
],
"VpcId": {
"Ref": "SampleClusterVpcD1C6ABD9"
}
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/Service/SecurityGroup/Resource"
}
},
"ServiceSecurityGroupfromCdkFargateStackLBSecurityGroupF16A57958011E231ABAF": {
"Type": "AWS::EC2::SecurityGroupIngress",
"Properties": {
"IpProtocol": "tcp",
"Description": "Load balancer to target",
"FromPort": 8011,
"GroupId": {
"Fn::GetAtt": [
"ServiceSecurityGroupC96ED6A7",
"GroupId"
]
},
"SourceSecurityGroupId": {
"Fn::GetAtt": [
"LBSecurityGroup8A41EA2B",
"GroupId"
]
},
"ToPort": 8011
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/Service/SecurityGroup/from CdkFargateStackLBSecurityGroupF16A5795:8011"
}
},
"LB8A12904C": {
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
"Properties": {
"LoadBalancerAttributes": [
{
"Key": "deletion_protection.enabled",
"Value": "false"
}
],
"Scheme": "internet-facing",
"SecurityGroups": [
{
"Fn::GetAtt": [
"LBSecurityGroup8A41EA2B",
"GroupId"
]
}
],
"Subnets": [
{
"Ref": "SampleClusterVpcPublicSubnet1SubnetE377A512"
},
{
"Ref": "SampleClusterVpcPublicSubnet2SubnetB88D2B08"
}
],
"Type": "application"
},
"DependsOn": [
"SampleClusterVpcPublicSubnet1DefaultRoute28A82BC4",
"SampleClusterVpcPublicSubnet2DefaultRouteFD4087CF"
],
"Metadata": {
"aws:cdk:path": "CdkFargateStack/LB/Resource"
}
},
"LBSecurityGroup8A41EA2B": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "Automatically created Security Group for ELB CdkFargateStackLBFC3A10CF",
"SecurityGroupIngress": [
{
"CidrIp": "0.0.0.0/0",
"Description": "Allow from anyone on port 80",
"FromPort": 80,
"IpProtocol": "tcp",
"ToPort": 80
}
],
"VpcId": {
"Ref": "SampleClusterVpcD1C6ABD9"
}
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/LB/SecurityGroup/Resource"
}
},
"LBSecurityGrouptoCdkFargateStackServiceSecurityGroupB491C33C801194A30A9B": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
"GroupId": {
"Fn::GetAtt": [
"LBSecurityGroup8A41EA2B",
"GroupId"
]
},
"IpProtocol": "tcp",
"Description": "Load balancer to target",
"DestinationSecurityGroupId": {
"Fn::GetAtt": [
"ServiceSecurityGroupC96ED6A7",
"GroupId"
]
},
"FromPort": 8011,
"ToPort": 8011
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/LB/SecurityGroup/to CdkFargateStackServiceSecurityGroupB491C33C:8011"
}
},
"LBListener49E825B4": {
"Type": "AWS::ElasticLoadBalancingV2::Listener",
"Properties": {
"DefaultActions": [
{
"TargetGroupArn": {
"Ref": "LBListenerECSGroup1D445DF5"
},
"Type": "forward"
}
],
"LoadBalancerArn": {
"Ref": "LB8A12904C"
},
"Port": 80,
"Protocol": "HTTP"
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/LB/Listener/Resource"
}
},
"LBListenerECSGroup1D445DF5": {
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
"Properties": {
"Port": 8011,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "ip",
"VpcId": {
"Ref": "SampleClusterVpcD1C6ABD9"
}
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/LB/Listener/ECSGroup/Resource"
}
},
"CDKMetadata": {
"Type": "AWS::CDK::Metadata",
"Properties": {
"Analytics": "v2:deflate64:H4sIAAAAAAAA/31Ry27CMBD8Fu7GBSr1TilFSFUVJYhr5ThbumDWkR9BKMq/184D0lbqaWdn18nMzoLPZ3w2ERc7lcVpqjDndeaEPLFAfdQgLa9XylsHhq0+aYCvwhyEg52wpxf4REKHmuLCb0aTE0hgRlz/NgNToYT4qIcNA7ng9b6UkdwnK5b4XKHMfE7g2sUbSrWPv88V3Pk7t7RWSxSDqHYQwXqbxPIu3CYouIgrSwxWUcztw1sK/gIeFjolfbd04TRfZyDHMpDeoLtujPZlZ+I/YksHA9b+4dct3TAUZ16nurMTaziGEtahVFoUuVCCJNKhCvdZlmU4SmvuLcye21kXz49+vIchNep3Bjya70IkwfKgfNQ2DUvBam+6pMY4ZFu0iTaMdAH8aB+q+ROfP/LF5GgRp8aTwzPwtKvfgpQF22sCAAA="
},
"Metadata": {
"aws:cdk:path": "CdkFargateStack/CDKMetadata/Default"
},
"Condition": "CDKMetadataAvailable"
}
},
TEST
I am checking the log in in aws web console.
Cluster > AdminCluster > service: CdkFargateStack-ServiceD69D759B-cYrAHaRDN4mF
in event tab,
There are log like this
Service tries to start the task every one minutes.
TEST
ECS supports docker-compose style deployment.
So I try this with same image, then it works well
$docker context ls
default * moby Current DOCKER_HOST based configuration unix:///var/run/docker.sock swarm
desktop-linux moby unix:///Users/whitebear/.docker/run/docker.sock
docker-lamp-ecs ecs
$docker context use docker-lamp-ecs
$docker compose docker-compose.yml up
this deployment finished correctly container starts on ECS
However it fails in CDK.
SOLUTION
I found out the solution.
This could work
const adminRepo = ecr.Repository.fromRepositoryArn(this, 'AdminRepository', 'arn:aws:ecr:ap-northeast-1:678100XXXXXX:repository/st_admin_site')
const adminImage = ecs.ContainerImage.fromEcrRepository(adminRepo,"latest");
The previous code,
const adminImage = ecs.ContainerImage.fromRegistry('st_admin_site:latest')
it doesn't mean to get my ecrRepository....
I use ARN instead.
This is stupid mistakes.
However there is not the way to get the log.
So it takes long time to find out.
Thank you for your help.
I had some stacks that took more than 30 minutes in the past :D How long were you waiting ?
What was the resources part looking ? What was already created, what was still "in action" :) ?
Did something crashed while creating and was in multiple retries ?
Not much information to really know what's happening, but IIRC if your container fails to start it will fail to create the ECS service. You can check if the service was actually created in the ECS console, and if it exists, check the event log to see if they aren't failing. If they are failing, you can check the reason in the task.

Deployment using RegistryManager.ApplyConfigurationContentOnDeviceAsync - Malformed Conent

I'm building a tool that can be used for Module deployment to IoTEdge based on a configured set or properties in a CMDB.
The tool is able to generate a Deployment manifest and is using the .NET SDK - specifically - RegistryManager.ApplyConfigurationContentOnDeviceAsync to apply the deployment.
The serialized string from ConfigurationContent is as follows. When this template is applied, there is no error in the SDK, however in the portal for the Edge it shows the status as 400 -- The deployment configuration is malformed or invalid.
This same template (just the ModulesContent) when applied using Single Device deployment in VSCode, works fine. So, not sure what is causing the template deployment to fail through RegistryManager. Unable to figure out the malformed content in the template. Appreciate any guidance.
{
"ModulesContent": {
"$edgeAgent": {
"properties.desired": {
"schemaVersion": "1.0",
"runtime": {
"type": "docker",
"settings": {
"minDockerVersion": "v1.25",
"loggingOptions": "",
"registryCredentials": {
"paddycontainers": {
"username": "XXXXXXcontainers",
"password": "EdgeHUBT9QuW=x2v3Z37jAZUREIOTg11uoT9Y",
"address": "XXXXXXcontainers.azurecr.io"
}
}
}
},
"systemModules": {
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0.9.2",
"createOptions": "{}"
}
},
"edgeHub": {
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0.9.2",
"createOptions": "{\"HostConfig\":{\"ExposedPorts\":{\"9600/tcp\":{},\"5671/tcp\":{},\"8883/tcp\":{}}}}"
},
"env": {
"experimentalfeatures__enabled": {
"value": true
},
"experimentalfeatures__enableMetrics": {
"value": true
}
}
}
},
"modules": {
"PySendModule1": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "paddycontainers.azurecr.io/pysendmodule:0.0.1-amd64.debug"
}
},
"PySendModule2": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "paddycontainers.azurecr.io/pysendmodule:0.0.1-amd64.debug"
}
},
"PySendModule3": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "paddycontainers.azurecr.io/pysendmodule:0.0.1-amd64.debug"
}
},
"PySendModule4": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "paddycontainers.azurecr.io/pysendmodule:0.0.1-amd64.debug"
}
},
"PySendModule5": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "paddycontainers.azurecr.io/pysendmodule:0.0.1-amd64.debug"
}
},
"PySendModule6": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "paddycontainers.azurecr.io/pysendmodule:0.0.1-amd64.debug"
}
},
"SimulatedTemperatureSensor1": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"createOptions": "{}"
}
},
"metricscollector1": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "veyalla/metricscollector:0.0.4-amd64",
"createOptions": "{}"
},
"env": {
"AzMonWorkspaceId": {
"value": "81nsaux72-0fec-8818-a258-71hshs7jas9"
},
"AzMonWorkspaceKey": {
"value": "81jsajswkjsdkahialkasdmacjklaja=="
}
}
}
}
}
},
"$edgeHub": {
"properties.desired": {
"schemaVersion": "1.0",
"routes": {},
"storeAndForwardConfiguration": {
"timeToLiveSecs": 7200
}
}
},
"PySendModule1": {
"properties.desired": {
"camera360": "172.1.1.1",
"fontSize": "10",
"message": 300,
"format": "Json",
"target": "AzureLogAnalytics",
"endpoints": {
"edgeHub": "http://edgeHub:9600/metrics"
}
}
},
"PySendModule2": {
"properties.desired": {
"camera360": "172.1.1.2",
"fontSize": "10",
"message": 300,
"format": "Json",
"target": "AzureLogAnalytics",
"endpoints": {
"edgeHub": "http://edgeHub:9600/metrics"
}
}
},
"PySendModule3": {
"properties.desired": {
"camera360": "172.1.1.3",
"fontSize": "10",
"message": 300,
"format": "Json",
"target": "AzureLogAnalytics",
"endpoints": {
"edgeHub": "http://edgeHub:9600/metrics"
}
}
},
"PySendModule4": {
"properties.desired": {
"camera360": "172.1.1.4",
"fontSize": "10",
"message": 300,
"format": "Json",
"target": "AzureLogAnalytics",
"endpoints": {
"edgeHub": "http://edgeHub:9600/metrics"
}
}
},
"PySendModule5": {
"properties.desired": {
"camera360": "172.1.1.5",
"fontSize": "10",
"message": 300,
"format": "Json",
"target": "AzureLogAnalytics",
"endpoints": {
"edgeHub": "http://edgeHub:9600/metrics"
}
}
},
"PySendModule6": {
"properties.desired": {
"camera360": "172.1.1.6",
"fontSize": "10",
"message": 300,
"format": "Json",
"target": "AzureLogAnalytics",
"endpoints": {
"edgeHub": "http://edgeHub:9600/metrics"
}
}
}
},
"DeviceContent": null
}
I don't exactly know the difference and why this works. I had a version of this tool being able to successfully deploy. I was using Newtonsoft for JSON parsing. I had switched to System.Text.Json in the CSharp SDK and that seems to have broken the JSON into a malformed state. I switched back to Newtonsoft and my deployments are good.

ARM Template for Importing Azure Key Vault Certificate in Function App

I have a function app which calls another API with a certificate. This certificate (.pfx) file is already present in the key vault. I am using below ARM template to import the certificate to SSL settings of the function app.
Note: the function app gets deployed fine when I remove section "hostNameSslStates". But after adding it, I get -
"Code": "Conflict",
"Message": "The certificate with thumbprint 'XXXXXXXX' does not match the hostname
'blobcreate-eventgridtrigger-functionapp.azurewebsites.net'."
ARM Template resources section-
`
"resources": [
//StorageAccount
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[parameters('storageAccounts_name')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "[parameters('storageSKU')]",
"tier": "Standard"
},
"kind": "StorageV2",
"properties": {
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
},
"supportsHttpsTrafficOnly": true,
"encryption": {
"services": {
"file": {
"keyType": "Account",
"enabled": true
},
"blob": {
"keyType": "Account",
"enabled": true
}
},
"keySource": "Microsoft.Storage"
},
"accessTier": "Hot"
}
},
//BlobService
{
"type": "Microsoft.Storage/storageAccounts/blobServices",
"apiVersion": "2019-06-01",
"name": "[variables('blobServiceName')]",
"dependsOn": ["[variables('storageAccountResourceId')]"],
"sku": {
"name": "[parameters('storageSKU')]"//,
// "tier": "Standard"
},
"properties": {
"cors": {
"corsRules": []
},
"deleteRetentionPolicy": {
"enabled": false
}
}
},
//function app with server farm
//cert store access policies update-
{
"type": "Microsoft.KeyVault/vaults",
"name": "testARMTemplateKeyVault",
"apiVersion": "2016-10-01",
"location": "[resourceGroup().location]",
"properties": {
"sku": {
"family": "A",
"name": "standard"
},
"tenantId": "c29678d0-eceb-4df2-a225-79cf795a6b64",
"accessPolicies": [
{
"tenantId": "tenantIdOfSubscription", //obtained from Get-AzTenant
"objectId": "objectid of Microsoft Azure App Service", //obtained from Get-AzADServicePrincipal
"permissions": {
"keys": [
"Get",
"List",
"Update",
"Create",
"Import",
"Delete",
"Recover",
"Backup",
"Restore"
],
"secrets": [
"Get",
"List",
"Set",
"Delete",
"Recover",
"Backup",
"Restore"
],
"certificates": [
"Get",
"List",
"Update",
"Create",
"Import",
"Delete",
"Recover",
"ManageContacts",
"ManageIssuers",
"GetIssuers",
"ListIssuers",
"DeleteIssuers"
],
"storage": []
}
}
],
"enabledForDeployment": false,
"enabledForDiskEncryption": false,
"enabledForTemplateDeployment": true,
"enableSoftDelete": true
}
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"name": "[variables('azurefunction_hostingPlanName')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "Y1",
"tier": "Dynamic"
},
"properties": {
"name": "[variables('azurefunction_hostingPlanName')]",
"computeMode": "Dynamic"
}
},
{
"type": "Microsoft.Web/certificates",
"name": "testingcert",
"apiVersion": "2016-03-01",
"location": "[resourceGroup().location]",
"properties": {
"keyVaultId": "[resourceId('Microsoft.KeyVault/vaults', 'testARMTemplateKeyVault')]",
"keyVaultSecretName": "testingcert",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('azurefunction_hostingPlanName'))]"
}
},
{
"apiVersion": "2018-11-01",
"type": "Microsoft.Web/sites",
"name": "[parameters('functionAppName')]",
"location": "[resourceGroup().location]",
"kind": "functionapp",
"dependsOn": [
"[variables('azureFunction_serverFarmResourceId')]",
"[variables('storageAccountResourceId')]",
"[resourceId('Microsoft.Web/certificates', 'testingcert')]"
],
"properties": {
"serverFarmId": "[variables('azureFunction_serverFarmResourceId')]",
"siteConfig": {
"appSettings": [
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccounts_name'), ';AccountKey=', listKeys(variables('storageAccountResourceId'),variables('storageAccountApiVersion')).keys[0].value)]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccounts_name'), ';AccountKey=', listKeys(variables('storageAccountResourceId'),variables('storageAccountApiVersion')).keys[0].value)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[toLower(parameters('functionAppName'))]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~2"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "~10"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('microsoft.insights/components/', parameters('functionApp_applicationInsightsName')), '2015-05-01').InstrumentationKey]"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet"
},
{
"name": "WEBSITE_LOAD_CERTIFICATES",
"value": "required certificate thumprint"
}
]
},
"hostNameSslStates": [
{
"name": "blobcreate-eventgridtrigger-functionapp.azurewebsites.net",//obtained from custom domains flatform features of the function app
"sslState": "SniEnabled",
"thumbprint": "[reference(resourceId('Microsoft.Web/certificates', 'testingcert')).Thumbprint]",
"toUpdate": true
}
]
}
}
]`
add certificates section in template -
{
"type": "Microsoft.Web/certificates",
"name": "[parameters('CertificateName')]",
"apiVersion": "2019-08-01",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Web/serverFarms/', variables('azurefunction_hostingPlanName'))]"
],
"properties": {
"keyVaultId": "[parameters('keyvaultResourceId')]",
"keyVaultSecretName": "[parameters('invoiceApiCertificateKeyVaultSecretName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('azurefunction_hostingPlanName'))]"
}
}
and then add dependsOn for this certificate in the function app-
[resourceId('Microsoft.Web/certificates', parameters('CertificateName'))]
well, the error is quite obvious, you are trying to add a certificate for blobcreate-eventgridtrigger-functionapp.azurewebsites.net but the dns name on the certificate doesnt match that, hence the error. that is probably not the right way to add a certificate unless its going to be used for SSL termination

Build configuration failed in angular 7

I want deployed angular project on server , right now i am comment one server code and build the project. for example i build project for QA , and then comment , and next i build project for INT. this take lot time , and i have to repeat this step for my all server. for alternate i do following configuration
i add configuration added in angular.json , and run following command
ng build --configuration qa
it give me following error
Schema validation failed with the following
errors:
Data path "['build']" should NOT have additional properties(int).
following is my angular.json
{
"$schema": "./node_modules/#angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"newBuiildProcess": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "#angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/newBuiildProcess",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": [],
"es5BrowserSupport": true
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
},
"int": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.int.ts"
}
]
},
"qa": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.qa.ts"
}
]
},
"beta": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.beta.ts"
}
]
}
},
"serve": {
"builder": "#angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "newBuiildProcess:build"
},
"configurations": {
"production": {
"browserTarget": "newBuiildProcess:build:production"
}
}
},
"extract-i18n": {
"builder": "#angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "newBuiildProcess:build"
}
},
"test": {
"builder": "#angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.css"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "#angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"newBuiildProcess-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
"architect": {
"e2e": {
"builder": "#angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "newBuiildProcess:serve"
},
"configurations": {
"production": {
"devServerTarget": "newBuiildProcess:serve:production"
}
}
},
"lint": {
"builder": "#angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "newBuiildProcess"
}
anybody can help me on this??
From the look at your angular.json file, the error is pretty clear the property build should not have an int type, it simply doesn't work that way. Additional build types must be added under configurations property that is under the build property. You can read it like this. Build -> Configurations -> list of configurations(int, dev, bla bla, bla)
example:
"build": { "configurations":{ "prod": {// prodOptions}, "hmr": {// otherOptions} } }

Resources