Running into AWS Elastic BeanStalk Event Error: Manifest file has schema validation errors - asp.net

I am setting up pipelines to AWS Elastic BeanStalk via bitbucket and I am running into: Manifest file has schema validation errors: Error Kind: ArrayItemNotValid, Path: #/aspNetCoreWeb.[0], Property: [0] Error Kind: PropertyRequired, Path: #/parameters.appBundle, Property: appBundle Error Kind: NoAdditionalPropertiesAllowed, Path: #/parameters, Property: parameters.
It seems that I am have a problem with my manifest file. However due to there being very little documentation on how to fix this problem. I am not able to resolve this issue. How do I solve this problem?
Here is my aws-windows-deployment-manifest file:
{
"manifestVersion": 1,
"deployments": {
"aspNetCoreWeb": [
{
"name": "CareerDash",
"parameters": {
"archive": "site",
"iisPath": "/"
}
}
]
}
}

Look like I figured it out. The issue is that the aws-windows-deployment-manifest.json file should be like the following:
{
"manifestVersion": 1,
"deployments": {
"aspNetCoreWeb": [
{
"name": "CareerDash",
"parameters": {
"appBundle": "site.zip", /*This line is where your web app file location is. The Web app folder should be in .zip file. */
"iisPath": "/" /* This line is the path to where your web app files are located in site.zip file, specifically the path to web.config file (which should be in the same level as your main web app files */
}
}
]
}
}
Overall your app bundle should be a zip file that contains the site.zip file and aws-windows-deployment-manifest.json file. In a hierarchy like so:
appBundleName.zip
site.zip
aws-windows-deployment-manifest.json

Related

Azure Bicep - can't access output from external module

I have a module called "privateendpoints.bicep" that creates a private endpoint as follows:
resource privateEndpoint_resource 'Microsoft.Network/privateEndpoints#2020-07-01' = {
name: privateEndpointName
location: resourceGroup().location
properties: {
subnet: {
id: '${vnet_resource.id}/subnets/${subnetName}'
}
privateLinkServiceConnections: [
{
name: privateEndpointName
properties: {
privateLinkServiceId: resourceId
groupIds: [
pvtEndpointGroupName_var
]
}
}
]
}
}
output privateEndpointIpAddress string = privateEndpoint_resource.properties.networkInterfaces[0].properties.ipConfigurations[0].properties.privateIPAddress
This is then referenced by a calling bicep file as follows:
module sqlPE '../../Azure.Modules/Microsoft.Network.PrivateEndpoints/1.0.0/privateendpoints.bicep' = {
name:'sqlPE'
params:{
privateEndpointName:'pe-utrngen-sql-${env}-001'
resourceId:sqlDeploy.outputs.sqlServerId
serviceType:'sql'
subnetName:'sub-${env}-utrngenerator01'
vnetName:'vnet-${env}-uksouth'
vnetResourceGroup:'rg-net-${env}-001'
}
}
var sqlPrivateLinkIpAddress = sqlPE.outputs.privateEndpointIpAddress
My problem is, it won't build. In VSCode I get the error The type "outputs" does not contain property "privateEndpointIpAddress"
This is the property I just added. Prior to me adding then all worked ok. I've made sure to save the updated external module and I've ensure right-clicked it in VSCode and selected build, it build ok and created a json file.
So, it seems the client bicep file is not picking up changes in the external module.
Any suggestions please?
The problem seemed to be caused by the fact I had the external module open in a separate VS Code instance. Once I closed this and opened the file in the same instance as the calling bicep file then it worked ok.

Storybook build success but error when serving

I have encountered a problem when serving a built storybook. As you can see below, it shows only a spinner spinning into oblivion. When i opened the console, it says:
Error: manager received sharedStateChanged-manager-storybook/viewport but was unable to determine the source of the event
Here's my storybook configuration files:
main.js
module.exports = {
stories: [
"../src/**/*.stories.mdx",
"../src/**/*.stories.#(js|jsx|ts|tsx)"
],
addons: [
"#storybook/addon-links",
"#storybook/addon-essentials",
"#storybook/preset-create-react-app"
],
webpackFinal: config => {
return {
...config,
plugins: config.plugins.filter(plugin => {
if (plugin.constructor.name === 'ESLintWebpackPlugin') {
return false
}
return true
}),
}
}
}
preview.js
import '../src/recore/.storybook/preview.css'
import * as Recore from '../src/recore'
Recore.init({
defaults: {
IMAGE_RESOLVER: path => {
return import('../src/assets/' + path)
}
}
})
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
}
To build the storybook, i run build-storybook -o ./build -s ./public -c .storybook
I am using npm, and it told me to do npm run build-storybook -- -o ... but it doesn't behave as expected. Also, I currently use "#storybook/react": "^6.1.21"
Has anyone encountered this problem before? Can you help me to fix it?
Many thanks before!
add "#storybook/builder-webpack5": "^6.2.9",
https://gist.github.com/shilman/8856ea1786dcd247139b47b270912324
When I had this problem I was starting the static file serving with npx serve -s.
Changing the startup to npx serve fixed the problem (this was hosting on a Linux web app in Azure).
Are you trying to deploy it to amplify?
If you are trying to deploy it to Amplify you need to rewrite some rules: (top to bottom)
1st rule: Source: /iframe.html Target: /iframe.html
2nd rule: Source: /<*> Target: /index.html
3rd rule: Source: </^[^.]+$|\.(?!(css|xml|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/> Target: /index.html
Be aware that the 1st rule the target is to iframe.html
I only needed 1 rule in my Amplify config to get storybook to work
Note the below is from terraform, but you should be able to grok it's meaning:
custom_rule {
source = "</^[^.]+$|\.(?!(html|css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$)([^.]+$)/>"
status = "200"
target = "/index.html"
}
For AWS AMPLIFY
Source address: /iframe.html
Target address: /iframe.html
Type: 200 (Rewrite)
Source address: /<*>
Target address: /index.html
Type: 404 (Redirect)
Source address: </^[^.]+$|.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|woff2|ttf|map|json|xlsx)$)([^.]+$)/>
Target address: /index.html
Type: 200 (Rewrite)
how it should look

why copy-from-recipe doesn't add any file to my base project?

I run a local flex server in my local pc (windows) from : https://github.com/moay/server-for-symfony-flex
and I made a recipe with config/routes/api-form-bundle.yaml
and my manifest :
{
"bundles": {
"XXX\\ApiFormBundle\\XXXApiFormBundle": ["all"]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/"
},
"composer-scripts": {
"make:migration": "symfony-cmd"
},
"aliases": ["xxx-apiform", "xxxapiform"]
}
I expect api-form.yaml file added to config/routes directory in my base project after composer install but nothing added. (alias and scripts work without problem)
what is the problem? am I write anything wrong?

Electron default app doesn't change

I am trying to convert my Google Closure Library used web app to Electron. I've used grunt-electron to package the application but it seems it doesn't change the default app of the Test.app. In Test.app/Contents/Contents/app/ there exist my application, but it doesn't load my app, but indeed loads default app.
My file hierarchy:
www: index.js (Electron config file), index.html, css/, fonts/, js/**
My grunt task:
electron: {
osxBuild: {
options: {
name: 'Test App',
dir: 'www',
out: 'build',
version: '0.25.3',
platform: 'darwin',
arch: 'x64'
}
}
}
Check if package.json file exists in your www directory and has main js set inside.
It should be something like:
{
"name" : "your-app",
"version" : "0.1.0",
"main" : "main.js"
}

Gradle - Web Module in deployment descriptor

I am trying to add a web module in an Ear file. I put it in my customized deployment descriptor using webModule(":wars/myweb","/mywebapp"). It is not including the war file in the ear file. It is just adding a entry in the generated application.xml with these details.
Can you please help in including a web module in ear, using customized deployment descriptor?
My ear task looks like this in build.gradle
ear {
libDirName ''
deploymentDescriptor {
// custom entries for application.xml:
// fileName = "application.xml" // same as the default value
version = "1.4" // same as the default value
applicationName = "myapp"
initializeInOrder = true
displayName = "myear" // defaults to project.name
description = "EAR for the basic package" // defaults to project.description
webModule(':wars/myweb','/mywebapp')
}
}
My settings.xml in the same dir as build.gradle looks like this
include "wars/myweb"
Appreciate your help.
I use this way to tie war dependencies to the webModules. The warMap provides a connection between the artifact id and the context path:
Map warMap = [
'my-war': 'contextpath',
'my2-war': 'contextpath2'
}
dependencies {
warMap.each {
deploy project(":$it.key")
}
}
ear {
deploymentDescriptor {
warMap.each {
webModule(it.key + '-' + project.version + ".war", it.value)
}
}
}

Resources